mirror of
https://github.com/nginx/nginx.git
synced 2024-12-20 06:03:31 -06:00
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".
This commit is contained in:
parent
b67dbca1ca
commit
4d0d2b20ac
@ -430,6 +430,10 @@ ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data)
|
||||
if (rrp->peers->single) {
|
||||
peer = &rrp->peers->peer[0];
|
||||
|
||||
if (peer->down) {
|
||||
goto failed;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/* there are several peers */
|
||||
|
Loading…
Reference in New Issue
Block a user