summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_proxy_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-06-07 12:23:23 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-06-07 12:23:23 +0000
commit1839e0d53c634818674eb7ca6333d109d96b949a (patch)
treebee56b3f0f1b460acad148eb646eb03539410cff /src/http/modules/ngx_http_proxy_module.c
parent99b468d6bde64f7691fc47c5bb343827f2d0ce3e (diff)
downloadnginx-1839e0d53c634818674eb7ca6333d109d96b949a.tar.gz
nginx-1839e0d53c634818674eb7ca6333d109d96b949a.tar.bz2
merge r3518, r3527:
cache related fixes: *) do not cache response if it has "no-store" or "private" in "Cache-Control" header *) proxy_no_cache and fastcgi_no_cache
Diffstat (limited to 'src/http/modules/ngx_http_proxy_module.c')
-rw-r--r--src/http/modules/ngx_http_proxy_module.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index 65c708662..518bf85d6 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -357,6 +357,13 @@ static ngx_command_t ngx_http_proxy_commands[] = {
0,
&ngx_http_proxy_module },
+ { ngx_string("proxy_no_cache"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
+ ngx_http_no_cache_set_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_proxy_loc_conf_t, upstream.no_cache),
+ NULL },
+
{ ngx_string("proxy_cache_valid"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
ngx_http_file_cache_valid_set_slot,
@@ -1933,6 +1940,7 @@ ngx_http_proxy_create_loc_conf(ngx_conf_t *cf)
#if (NGX_HTTP_CACHE)
conf->upstream.cache = NGX_CONF_UNSET_PTR;
conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
+ conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
#endif
@@ -2157,6 +2165,9 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|NGX_HTTP_UPSTREAM_FT_OFF;
}
+ ngx_conf_merge_ptr_value(conf->upstream.no_cache,
+ prev->upstream.no_cache, NULL);
+
ngx_conf_merge_ptr_value(conf->upstream.cache_valid,
prev->upstream.cache_valid, NULL);