Mercurial > hg > nginx
changeset 4447:2b2d51cdbd97 stable-1.0
Merge of r4402:
Fixed proxy_cache_use_stale in "no live upstreams" case.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sun, 05 Feb 2012 19:23:44 +0000 |
parents | fd40c9ef750d |
children | 539355d9e675 |
files | src/http/modules/ngx_http_fastcgi_module.c src/http/modules/ngx_http_proxy_module.c src/http/modules/ngx_http_scgi_module.c src/http/modules/ngx_http_uwsgi_module.c |
diffstat | 4 files changed, 21 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_fastcgi_module.c Sun Feb 05 19:15:09 2012 +0000 +++ b/src/http/modules/ngx_http_fastcgi_module.c Sun Feb 05 19:23:44 2012 +0000 @@ -2214,6 +2214,10 @@ |NGX_HTTP_UPSTREAM_FT_OFF; } + if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) { + conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE; + } + if (conf->upstream.cache_methods == 0) { conf->upstream.cache_methods = prev->upstream.cache_methods; }
--- a/src/http/modules/ngx_http_proxy_module.c Sun Feb 05 19:15:09 2012 +0000 +++ b/src/http/modules/ngx_http_proxy_module.c Sun Feb 05 19:23:44 2012 +0000 @@ -1903,17 +1903,21 @@ (NGX_CONF_BITMASK_SET |NGX_HTTP_UPSTREAM_FT_OFF)); + if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) { + conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET + |NGX_HTTP_UPSTREAM_FT_OFF; + } + + if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) { + conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE; + } + if (conf->upstream.cache_methods == 0) { conf->upstream.cache_methods = prev->upstream.cache_methods; } conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD; - if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) { - conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET - |NGX_HTTP_UPSTREAM_FT_OFF; - } - ngx_conf_merge_ptr_value(conf->upstream.cache_bypass, prev->upstream.cache_bypass, NULL);
--- a/src/http/modules/ngx_http_scgi_module.c Sun Feb 05 19:15:09 2012 +0000 +++ b/src/http/modules/ngx_http_scgi_module.c Sun Feb 05 19:23:44 2012 +0000 @@ -1237,6 +1237,10 @@ |NGX_HTTP_UPSTREAM_FT_OFF; } + if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) { + conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE; + } + if (conf->upstream.cache_methods == 0) { conf->upstream.cache_methods = prev->upstream.cache_methods; }
--- a/src/http/modules/ngx_http_uwsgi_module.c Sun Feb 05 19:15:09 2012 +0000 +++ b/src/http/modules/ngx_http_uwsgi_module.c Sun Feb 05 19:23:44 2012 +0000 @@ -1298,6 +1298,10 @@ |NGX_HTTP_UPSTREAM_FT_OFF; } + if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) { + conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE; + } + if (conf->upstream.cache_methods == 0) { conf->upstream.cache_methods = prev->upstream.cache_methods; }