Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
node.js proxy in nginx w/ https
http {
upstream node_server {
server 127.0.0.1:2222;
}
server {
listen 443 ssl;
server_name example.com;
ssl on;
ssl_certificate /etc/nginx/ssl/crt.crt;
ssl_certificate_key /etc/nginx/ssl/key.key;
ssl_session_timeout 5m;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://node_server/;
proxy_redirect off;
}
}
}
@ynahmany
Copy link

ynahmany commented Dec 31, 2014

Good one.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment