diff options
author | Valentin Bartenev <vbart@nginx.com> | 2014-12-22 12:58:59 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2014-12-22 12:58:59 +0300 |
commit | 66dcbab7a13bc0cf5212aebd662dcb23cec8808d (patch) | |
tree | 2b82b5787c5f0c78f71eafcb41c58eaa3b6c5871 /src/http/modules/ngx_http_fastcgi_module.c | |
parent | 492844dbb18035617b6c220c4a857d9333c6ea61 (diff) | |
download | nginx-66dcbab7a13bc0cf5212aebd662dcb23cec8808d.tar.gz nginx-66dcbab7a13bc0cf5212aebd662dcb23cec8808d.zip |
Upstream: mutually exclusive inheritance of "cache" and "store".
Currently, storing and caching mechanisms cannot work together, and a
configuration error is thrown when the proxy_store and proxy_cache
directives (as well as their friends) are configured on the same level.
But configurations like in the example below were allowed and could result
in critical errors in the error log:
proxy_store on;
location / {
proxy_cache one;
}
Only proxy_store worked in this case.
For more predictable and errorless behavior these directives now prevent
each other from being inherited from the previous level.
Diffstat (limited to 'src/http/modules/ngx_http_fastcgi_module.c')
-rw-r--r-- | src/http/modules/ngx_http_fastcgi_module.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c index b7d07daad..aa2dcd7e5 100644 --- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -2432,6 +2432,20 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) ngx_hash_init_t hash; ngx_http_core_loc_conf_t *clcf; +#if (NGX_HTTP_CACHE) + + if (conf->upstream.store > 0) { + conf->upstream.cache = NULL; + } + + if (conf->upstream.cache != NGX_CONF_UNSET_PTR + && conf->upstream.cache != NULL) + { + conf->upstream.store = 0; + } + +#endif + if (conf->upstream.store == NGX_CONF_UNSET) { ngx_conf_merge_value(conf->upstream.store, prev->upstream.store, 0); |