Skip to content

Commit 3fe63ef

Browse files
committed
Revert "return 503 if not all upstreams are up"
1 parent f3eaaab commit 3fe63ef

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

ngx_http_upstream_check_module.c

+1-18
Original file line numberDiff line numberDiff line change
@@ -2915,10 +2915,8 @@ static ngx_int_t
29152915
ngx_http_upstream_check_status_handler(ngx_http_request_t *r) {
29162916
size_t buffer_size;
29172917
ngx_int_t rc;
2918-
ngx_uint_t i, all_up;
29192918
ngx_buf_t *b;
29202919
ngx_chain_t out;
2921-
ngx_http_upstream_check_peer_t *peer;
29222920
ngx_http_upstream_check_peers_t *peers;
29232921
ngx_http_upstream_check_loc_conf_t *uclcf;
29242922
ngx_http_upstream_check_status_ctx_t *ctx;
@@ -2981,22 +2979,7 @@ ngx_http_upstream_check_status_handler(ngx_http_request_t *r) {
29812979

29822980
ctx->format->output(b, peers, ctx->flag);
29832981

2984-
2985-
// check if all peers are up or not
2986-
peer = peers->peers.elts;
2987-
all_up = 1;
2988-
for (i = 0; i < peers->peers.nelts; i++) {
2989-
if (peer[i].shm->down) {
2990-
all_up = 0;
2991-
break;
2992-
}
2993-
}
2994-
2995-
if (all_up == 1) {
2996-
r->headers_out.status = NGX_HTTP_OK;
2997-
} else {
2998-
r->headers_out.status = NGX_HTTP_SERVICE_UNAVAILABLE;
2999-
}
2982+
r->headers_out.status = NGX_HTTP_OK;
30002983
r->headers_out.content_length_n = b->last - b->pos;
30012984

30022985
if (r->headers_out.content_length_n == 0) {

0 commit comments

Comments
 (0)