Skip to content

Instantly share code, notes, and snippets.

@vtajzich
Created December 6, 2015 20:40
Show Gist options
  • Save vtajzich/eaa0312d76979479909b to your computer and use it in GitHub Desktop.
Save vtajzich/eaa0312d76979479909b to your computer and use it in GitHub Desktop.
How to enable ssl w/ nginx
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