Nodejs websocket 502 bad gateway

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


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:, server:, request:
> "GET / HTTP/1.1", upstream: "", host: ""

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

More information about the nginx mailing list