# HG changeset patch # User Ruslan Ermilov # Date 1353068285 0 # Node ID dcb853acae9750f0a804cdd193f6c2ce35e5da1c # Parent 002f2c783d7cb3faa9428b7656c134bd858a1cb1 Upstream: honor the "down" flag for a single server. If an upstream block was defined with the only server marked as "down", e.g. upstream u { server 127.0.0.1:8080 down; } an attempt was made to contact the server despite the "down" flag. It is believed that immediate 502 response is better in such a case, and it's also consistent with what is currently done in case of multiple servers all marked as "down". diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c --- a/src/http/ngx_http_upstream_round_robin.c +++ b/src/http/ngx_http_upstream_round_robin.c @@ -430,6 +430,10 @@ ngx_http_upstream_get_round_robin_peer(n if (rrp->peers->single) { peer = &rrp->peers->peer[0]; + if (peer->down) { + goto failed; + } + } else { /* there are several peers */