Created
December 6, 2015 20:40
-
-
Save vtajzich/eaa0312d76979479909b to your computer and use it in GitHub Desktop.
How to enable ssl w/ 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
server { | |
listen 80; | |
server_name your-domain.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name your-domain.com; | |
keepalive_timeout 70; | |
ssl_certificate /etc/letsencrypt/live/<cert_path>/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/<cert_path>/privkey.pem; | |
location / { | |
proxy_pass http://<app>; | |
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