Welcome! Log In Create A New Profile

Advanced

Websockets proxy and nginx upstream

Posted by ranjitiyer 
Websockets proxy and nginx upstream
December 22, 2013 02:44PM
Hi,

I am trying to setup NginX as a reverse proxy for my WebSockets server. I have two backend servers and want the WebSocket connection calls to fail over between the machines if one of them is not available. I configured it such, but I don't see the fail over take place. Is the upstream module supported for WebSocket proxying?

upstream cluster {
server localhost:8001;
server localhost:8002;
}

server {
listen 8090;
server_name localhost;

location / {
proxy_pass http://cluster;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

Ranjit
Re: Websockets proxy and nginx upstream
December 22, 2013 03:21PM
It looks like the fail over works, but it took way longer than it took for an regular HTTP connection. Perhaps the fail_timeout and max_fail defaults are different for WebSocket connections. Are these properties configurable in the free edition of nGinx?

Thanks.
Ranjit
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 131
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready