node.js - Sticky load balancing on nginx reverse proxy not working -


i'm trying setup reverse proxy on existing nginx web server. have started 3 nodejs-socket.io servers on

195.93.x.x:6001; 195.93.x.x:6002; 195.93.x.x:6003; 

i can access socket.io on them separately, such as: http://195.93.x.x:6001/socket.io/socket.io.js through nginx reverse proxy can't access socket.io servers. request http://myserver.com/push/socket.io/socket.io.js returns cannot /push/socket.io/socket.io.js status 404.

any highly appreciated

below contents nginx.conf file:

server { listen 80; server_name myserver.com www.myserver.com; error_log /var/log/nginx-error.log;  upstream pusher {     ip_hash;     server 195.93.x.x:6001;     server 195.93.x.x:6002;     server 195.93.x.x:6003;          }     location  /push {     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://pusher;            }      location / {      index index.php index.html;      try_files $uri $uri/ /index.php?q=$uri&$args;       #proxy_set_header host $http_host;      proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;      proxy_set_header    x-real-ip       $remote_addr;      proxy_set_header "domain" $http_host;      root   /var/www/site/www;     }         # pass php scripts fastcgi server listening on 127.0.0.1:9000      location ~ \.php$ {         #fastcgi_pass   127.0.0.1:9000;         fastcgi_param remote_addr $http_x_real_ip;         fastcgi_pass   unix:/tmp/php-fpm.sock;         fastcgi_index  index.php;         fastcgi_buffers 4 256k;         fastcgi_busy_buffers_size 256k;         fastcgi_temp_file_write_size 256k;         fastcgi_param  script_filename  /var/www/site/www$fastcgi_script_name;         include        fastcgi_params;     } 


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -