Help, Bad gateway 502 varnish + nginx upload file

Stefan Caunter stef at
Fri Jul 22 19:43:19 UTC 2011

On Fri, Jul 22, 2011 at 7:11 AM, Benz Chandra <benzchandra91 at> wrote:
> Hello.. i'm bew in here, first i'm sorry for my bad english and wrong place
> for posting.
> y problem. I have a server which is installed varnish and nginx as proxy
> site and serve static pages. It run smooth, all can work together, apache
> for serving dynamic pages, varnish cache from apache, and nginx as proxy.
> Now the problem, when i upload something like attachment on my web email, it
> show Bad Gateway 502.
> so weird, i upload smaller file arround 100kb, show bad gateway too..
> i check the buffer and increase it, but it didn;t solve this problem..
> i get an error from vhost-log nginx.
> recv() failed (104: Connection reset by peer) while reading response header
> from upstream.
> Any clue about this? i really really appreciate who help me out this
> problem.

Does it work without varnish?

You need to use pipe() on varnish for uploads; make sure you check
your timeout setting.

Default pipe timeout is 60 seconds, which might not be long enough.


> Thanks.
> _______________________________________________
> nginx mailing list
> nginx at

More information about the nginx mailing list