Mercurial > hg > nginx
comparison src/http/modules/ngx_http_proxy_module.c @ 5948:f2ff0aa89126
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.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Mon, 22 Dec 2014 12:58:59 +0300 |
parents | d9025ea1f5a5 |
children | 634da79665d3 |
comparison
equal
deleted
inserted
replaced
5947:d9025ea1f5a5 | 5948:f2ff0aa89126 |
---|---|
2622 ngx_hash_init_t hash; | 2622 ngx_hash_init_t hash; |
2623 ngx_http_core_loc_conf_t *clcf; | 2623 ngx_http_core_loc_conf_t *clcf; |
2624 ngx_http_proxy_rewrite_t *pr; | 2624 ngx_http_proxy_rewrite_t *pr; |
2625 ngx_http_script_compile_t sc; | 2625 ngx_http_script_compile_t sc; |
2626 | 2626 |
2627 #if (NGX_HTTP_CACHE) | |
2628 | |
2629 if (conf->upstream.store > 0) { | |
2630 conf->upstream.cache = NULL; | |
2631 } | |
2632 | |
2633 if (conf->upstream.cache != NGX_CONF_UNSET_PTR | |
2634 && conf->upstream.cache != NULL) | |
2635 { | |
2636 conf->upstream.store = 0; | |
2637 } | |
2638 | |
2639 #endif | |
2640 | |
2627 if (conf->upstream.store == NGX_CONF_UNSET) { | 2641 if (conf->upstream.store == NGX_CONF_UNSET) { |
2628 ngx_conf_merge_value(conf->upstream.store, | 2642 ngx_conf_merge_value(conf->upstream.store, |
2629 prev->upstream.store, 0); | 2643 prev->upstream.store, 0); |
2630 | 2644 |
2631 conf->upstream.store_lengths = prev->upstream.store_lengths; | 2645 conf->upstream.store_lengths = prev->upstream.store_lengths; |