Meteor App Nginx Log Shows (104: Connection reset by peer) while reading response header from upstream

Hi,

We have a Meteor App, with SSL on, and nginx as reverse proxy server. Once in a while, browser console will show:

GET https://www.domain.com/sockjs/info?cb=9rwia7gly6 502 (Bad Gateway)

After checking the Nginx error log, the followings are seen:

2017/02/09 15:25:49 [error] 22098#22098: *1357 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: [client ip address], server: www.domain.com, request: “GET /sockjs/info?cb=9rwia7gly6 HTTP/1.1”, upstream: “http:// 127.0.0.1:3000/sockjs/info?cb=9rwia7gly6”, host: “www.domain.com”, referrer: “https ://www.domain.com/”

What can the reason of the issue? Thank you so much!!

I am facing the same problem, and this problem became my nightmare!

This problem happened to me after a new deployment and i am not sure if it was happening all the time or not, but after the new deploy it appeared clearly and it was killing my website.

Did you solve this problem?