Created
December 31, 2014 07:39
-
-
Save Radagaisus/85b98fa008bd2939575d to your computer and use it in GitHub Desktop.
node.js proxy in nginx w/ https
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
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; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good one.
Thanks!