Upstream: jump out of loop after matching the status code.
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index 89e1319..be96be4 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c
@@ -2502,6 +2502,8 @@ } #endif + + break; } #if (NGX_HTTP_CACHE)