Error Nginx 502 [upstream prematurely closed connection]

Maxim Dounin mdounin at mdounin.ru
Mon Oct 12 11:39:00 UTC 2015


Hello!

On Sun, Oct 11, 2015 at 05:42:37PM -0400, javdev wrote:

> Hello guys this is my first question here.
> 
> I'm working on nginx almost 2 years, but in the laste days I have founded an
> error, very complicated to solve.
> 
> I'm working on Amazon stack, with Elastic Load Balancer (Using TCP (SSL)),
> then the request is sent to Nginx (1.8.0), 2 EC2 Instances, each instance
> has a Sails project (running on 1337 port).
> 
> The connectio is amolst fine, actually sometimes works fine, but after 3 or
> 5 refresh page, throw the next 502 error:
> 
> --- code error ----
> 2015/10/11 20:14:46 [error] 4623#0: *38 upstream prematurely closed
> connection while reading response header from upstream, client:
> 172.31.35.22, server: , request: "GET
> /socket.io/?__sails_io_sdk_version=0.11.0&__sails_io_sdk_platform=browser&__sails_io_sdk_language=javascript&EIO=3&transport=websocket&sid=2Cn2Vmz2ovRgBxWNAAA3
> HTTP/1.1", upstream:
> "http://127.0.0.1:1337/socket.io/?__sails_io_sdk_version=0.11.0&__sails_io_sdk_platform=browser&__sails_io_sdk_language=javascript&EIO=3&transport=websocket&sid=2Cn2Vmz2ovRgBxWNAAA3",
> host: "sails-load-balancer-1968414874.us-west-2.elb.amazonaws.com"
> ----- End code error----

The message suggests that something happened on your backend.  You 
have to look into its logs to find out more details.

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



More information about the nginx mailing list