nginx doesn't switch upstream in some cases

Guillaume Filion gfk at
Wed Feb 10 18:34:16 MSK 2010

Maxim Dounin a écrit :
> On Wed, Feb 10, 2010 at 09:19:07AM -0500, Guillaume Filion wrote:
>> We're running nginx as a load balancer in front of two reverse proxies
>> (Apache2/mod_security) for our web site.
>> It's been working great except last night apache stopped on one of the
>> reverse proxy and nginx would continue sending HTTP requests to it. The
>> result was that about 50% of the requests to the web site failed.
> [...]
>>     proxy_next_upstream error timeout invalid_header http_500;
> Which status code your reverse proxy returns once backend is down?  
> Most likely it's 502 or 504, so you have to add them to 
> proxy_next_upstream.

Thanks for the tip, effectively I should add http_502, http_503 and
http_504 to my proxy_next_upstream.

However, last night's problem was not with a backend, but with a reverse
proxy. The machine was still up (responding to pings) but apache was not

The was no response to HTTP requests to the reverse proxy. I guess
that's the "timeout" directive, but somehow that didn't work...

Guillaume Filion

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the nginx mailing list