aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_proxy_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules/ngx_http_proxy_module.c')
-rw-r--r--src/http/modules/ngx_http_proxy_module.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index f7f91d662..480e9749a 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -3357,6 +3357,20 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
#endif
+ /*
+ * special handling to preserve conf->headers in the "http" section
+ * to inherit it to all servers
+ */
+
+ if (prev->headers.hash.buckets == NULL
+ && conf->headers_source == prev->headers_source)
+ {
+ prev->headers = conf->headers;
+#if (NGX_HTTP_CACHE)
+ prev->headers_cache = conf->headers_cache;
+#endif
+ }
+
return NGX_CONF_OK;
}