Last active
September 5, 2015 13:41
-
-
Save ceremcem/5176ac7215b5b669f601 to your computer and use it in GitHub Desktop.
Nginx proxy node.js socket.io app
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
# this is the necessary configurations for | |
# proxying a socket.io Node.js application with Nginx | |
# | |
# check for updates at: https://gist.github.com/ceremcem/5176ac7215b5b669f601 | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-Proto https; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_read_timeout 86400; | |
# usage example | |
# ############# | |
# (save this file as /etc/nginx/websocket_proxy_params) | |
# | |
# this block creates a proxy for http://10.0.10.176:4000 at http(s)://server-addr/hmi | |
# location ~ /hmi { | |
# rewrite ^([^.]*[^/])$ $1/ permanent; | |
# rewrite /hmi/(.*) /$1 break; | |
# proxy_pass http://10.0.10.176:4000; | |
# include websocket_proxy_params; | |
#} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment