diff src/http/ngx_http_core_module.c @ 6906:1aeaae6e9446

Upstream: proxy_cache_background_update and friends. The directives enable cache updates in subrequests.
author Roman Arutyunyan <arut@nginx.com>
date Fri, 10 Feb 2017 15:13:41 +0300
parents 25203fc377fb
children 8b7fd958c59f
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -2566,6 +2566,17 @@ ngx_http_subrequest(ngx_http_request_t *
 
     *psr = sr;
 
+    if (flags & NGX_HTTP_SUBREQUEST_CLONE) {
+        sr->method = r->method;
+        sr->method_name = r->method_name;
+        sr->loc_conf = r->loc_conf;
+        sr->valid_location = r->valid_location;
+        sr->phase_handler = r->phase_handler;
+        sr->write_event_handler = ngx_http_core_run_phases;
+
+        ngx_http_update_location_config(sr);
+    }
+
     return ngx_http_post_request(sr, NULL);
 }