Created
April 28, 2018 05:32
-
-
Save inhere/d6d42505ba92ea336d419d54450521a5 to your computer and use it in GitHub Desktop.
Nginx configuration for websocket server
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
upstream io_nodes { | |
ip_hash; | |
server 127.0.0.1:6001; | |
server 127.0.0.1:6002; | |
server 127.0.0.1:6003; | |
server 127.0.0.1:6004; | |
} | |
server { | |
listen 3000; | |
server_name io.yourhost.com; | |
location / { | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $host; | |
proxy_http_version 1.1; | |
proxy_pass http://io_nodes; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment