Created
March 14, 2013 16:49
-
-
Save ykrkn/5162960 to your computer and use it in GitHub Desktop.
nginx 1.3.14 + nginx-sticky-module = ws/xhr polling + round robin + sticky sessions
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 client_handler { | |
sticky; # !important | |
server 127.0.0.1:8000; | |
server 127.0.0.1:8001; | |
server 127.0.0.1:8002; | |
server 127.0.0.1:8003; | |
} | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
server { | |
listen 80 default_server; | |
#server_name alena3; | |
location / { | |
root /home/www/public; | |
index index.html index.htm; | |
} | |
location /engine.io/ { | |
proxy_pass http://client_handler; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection $connection_upgrade; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment