Last active
August 23, 2017 00:49
-
-
Save mb00g/dfb06843a7be625328ffe9934fd65832 to your computer and use it in GitHub Desktop.
Konfigurasi Nginx Proxy + SSL
This file contains hidden or 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
server { | |
listen 0.0.0.0:80; | |
server_name myserver.example; | |
# Always redirect to HTTPS | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen 0.0.0.0:443 ssl; | |
server_name myserver.example; | |
# ssl on; | |
ssl_certificate /etc/nginx/ssl/myserver.example/ssl-bundle.crt; | |
ssl_certificate_key /etc/nginx/ssl/myserver.example/myserver.key; | |
# side note: only use TLS since SSLv2 and SSLv3 have had recent vulnerabilities | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
location / { | |
proxy_pass http://127.0.0.1:3000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment