Skip to content

Instantly share code, notes, and snippets.

@ykrkn
Created March 14, 2013 16:49
Show Gist options
  • Save ykrkn/5162960 to your computer and use it in GitHub Desktop.
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
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