mirror of
https://github.com/nginx/nginx.git
synced 2025-06-08 02:02:38 +08:00
Fixed proxy_cache_use_stale in "no live upstreams" case.
This commit is contained in:
parent
4efcbce328
commit
2c55914a9f
@ -2314,6 +2314,10 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
|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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -1286,6 +1286,10 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
|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;
|
||||
}
|
||||
|
@ -1338,6 +1338,10 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
|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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user