aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_proxy_module.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2012-01-16 11:01:52 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2012-01-16 11:01:52 +0000
commit2c55914a9fad0938dd35b2c6ae99cc7f568ada9c (patch)
treef956cb03034785f44b885141afd1816e3dbd1670 /src/http/modules/ngx_http_proxy_module.c
parent4efcbce3289803bb087ff78ee2b3784558daed27 (diff)
downloadnginx-2c55914a9fad0938dd35b2c6ae99cc7f568ada9c.tar.gz
nginx-2c55914a9fad0938dd35b2c6ae99cc7f568ada9c.zip
Fixed proxy_cache_use_stale in "no live upstreams" case.
Diffstat (limited to 'src/http/modules/ngx_http_proxy_module.c')
-rw-r--r--src/http/modules/ngx_http_proxy_module.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index 5329351e4..b6aa38b53 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -2685,17 +2685,21 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
(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);