Last active
August 3, 2018 14:47
-
-
Save linnil1/a319b366fe8d52e90c7034479b34588a to your computer and use it in GitHub Desktop.
Simple nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nginx; | |
worker_processes 1; | |
error_log /etc/nginx/log/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
'$status $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for"'; | |
access_log /etc/nginx/log/access.log main; | |
# sendfile on; | |
#gzip on; | |
keepalive_timeout 65; | |
server { | |
listen 80; | |
server_name my.domain.ntu.edu.tw; | |
return 301 https://my.domain.ntu.edu.tw; | |
} | |
server { | |
server_name my.domain.ntu.edu.tw; | |
listen 80; | |
listen 443 ssl; | |
ssl_certificate /certs/fullchain.pem; | |
ssl_certificate_key /certs/privkey.pem; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
#charset koi8-r; | |
location = /favicon.ico { | |
alias /etc/nginx/html/favicon.ico; | |
} | |
location / { | |
root /etc/nginx/html; | |
try_files /index.html /index.html; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment