summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_upstream.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2015-11-11 15:47:30 +0300
committerRoman Arutyunyan <arut@nginx.com>2015-11-11 15:47:30 +0300
commit89a049be89a2d0507bf1e4558733934bf6597432 (patch)
treee21a83691a7fe266008f413d14966cec9b89604c /src/http/ngx_http_upstream.c
parent93aef089b44cf2a0bcb276eaa17ccea43024f5c2 (diff)
downloadnginx-89a049be89a2d0507bf1e4558733934bf6597432.tar.gz
nginx-89a049be89a2d0507bf1e4558733934bf6597432.tar.bz2
Upstream: proxy_cache_convert_head directive.
The directive toggles conversion of HEAD to GET for cacheable proxy requests. When disabled, $request_method must be added to cache key for consistency. By default, HEAD is converted to GET as before.
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r--src/http/ngx_http_upstream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 153059699..74fffd5c8 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -764,7 +764,7 @@ ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u)
return rc;
}
- if (r->method & NGX_HTTP_HEAD) {
+ if ((r->method & NGX_HTTP_HEAD) && u->conf->cache_convert_head) {
u->method = ngx_http_core_get_method;
}