ngx upstream round robin bug?

defage nginx-forum at
Fri Dec 23 09:41:59 UTC 2011

I use nginx as a load balancing for backend web server.
 if this upstream has n servers, and when the number of backend web
server can't connect(502 or down) be equal n-1, nginx will response  502
or 503 status to client.  
I did some test, only in the use of directer like:
    server max_fails=NUM1 fail_timeout=NUM2;

within NUM2 second time, send request times > NUM1, the (NUM1+1)st 
resquest will response 502 or 503. The above will be happened.

nginx version:1.0.11, centos5.4 x86_64
this is my conf
upstream backend {
    server max_fails=10 fail_timeout=100;  #normal
    server max_fails=10 fail_timeout=100;  #had down
    server max_fails=10 fail_timeout=100;  #had down

location / {
    proxy_pass        http://backend;

the access_log when error happened like:
/cas/login?gateway=true&service= 502,
backend, 0.002, 0.000

Posted at Nginx Forum:,220415,220415#msg-220415

More information about the nginx mailing list