Skip to content

Instantly share code, notes, and snippets.

@1ambda
Created August 11, 2014 13:43
Show Gist options
  • Save 1ambda/212b7a8797a472f6599a to your computer and use it in GitHub Desktop.
Save 1ambda/212b7a8797a472f6599a to your computer and use it in GitHub Desktop.
Nginx https setting for Node.js
# http://stackoverflow.com/questions/10375659/nginx-proxy-pass-node-ssl
server {
listen 443;
ssl on;
ssl_certificate newlocalhost.crt;
ssl_certificate_key newlocalhost.key;
server_name nodejs.newlocalhost.com;
add_header Strict-Transport-Security max-age=500;
location / {
proxy_pass http://nodejs;
proxy_redirect off;
proxy_set_header Host $host ;
proxy_set_header X-Real-IP $remote_addr ;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
proxy_set_header X-Forwarded-Proto https;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment