Nodejs websocket 502 bad gateway

Maxim Dounin mdounin at mdounin.ru
Mon Apr 7 11:53:14 UTC 2014


Hello!

On Mon, Apr 07, 2014 at 07:38:00AM -0400, zajca wrote:

> I'm trying to make work nginx 1.4.7 with nodejs websockets
> but I'm getting 502 bad gateway
> 
> NGINX Error:
> [error] 2394#0: *1 upstream prematurely closed connection while reading
> response header from upstream, client: 127.0.0.1, server: xxx.cz, request:
> "GET / HTTP/1.1", upstream: "http://127.0.0.1:8090/", host: "xxx.cz"

As per the error message, you backend closes connection for some 
reason, instead of returning proper 101 Switching Protocols 
response.  You may want to look into your backend to find out why 
it does so.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list