nginx doesn't switch upstream in some cases

Maxim Dounin mdounin at mdounin.ru
Wed Feb 10 17:34:42 MSK 2010


Hello!

On Wed, Feb 10, 2010 at 09:19:07AM -0500, Guillaume Filion wrote:

> Hi all,
> 
> 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.
> 
> If I unplug the reverse proxy, nginx detects that it's down and will
> only send requests to the "good" reverse proxy.
> 
> Here's my config, I guess that my "proxy_next_upstream" is wrong but I
> can't figure out how... It would be great if someone could shed some
> light on this issue for me.

[...]

>     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.

Maxim Dounin



More information about the nginx mailing list