changeset 2804:edc0cd9db5cf

proxy/fastcgi_cache_use_stale http_50x did not work
author Igor Sysoev <igor@sysoev.ru>
date Tue, 05 May 2009 15:17:00 +0000
parents 60758ab4e5f4
children 60551422e150
files src/http/ngx_http_upstream.c
diffstat 1 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1475,10 +1475,6 @@ ngx_http_upstream_test_next(ngx_http_req
     ngx_uint_t                 status;
     ngx_http_upstream_next_t  *un;
 
-    if (!(u->conf->next_upstream & NGX_HTTP_UPSTREAM_FT_STATUS)) {
-        return NGX_DECLINED;
-    }
-
     status = u->headers_in.status_n;
 
     for (un = ngx_http_upstream_next_errors; un->status; un++) {
@@ -1494,10 +1490,7 @@ ngx_http_upstream_test_next(ngx_http_req
 
 #if (NGX_HTTP_CACHE)
 
-        if (u->peer.tries == 0
-            && u->stale_cache
-            && (u->conf->cache_use_stale & un->mask))
-        {
+        if (u->stale_cache && (u->conf->cache_use_stale & un->mask)) {
             ngx_http_upstream_finalize_request(r, u,
                                            ngx_http_upstream_cache_send(r, u));
             return NGX_OK;