diff src/http/ngx_http_upstream.c @ 6290:4d5ac1a31d44

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.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 11 Nov 2015 15:47:30 +0300
parents 257b51c37c5a
children a93345ee8f52
line wrap: on
line diff
--- 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
             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;
         }