Mercurial > hg > nginx
diff src/http/modules/ngx_http_proxy_module.c @ 6747:20eb4587225b
Upstream: handling of proxy_set_header at http level.
When headers are set at the "http" level and not redefined in
a server block, we now preserve conf->headers into the "http"
section configuration to inherit it to all servers.
The same applies to conf->headers_cache, though it may not be effective
if no servers use cache at the "server" level as conf->headers_cache
is only initialized if cache is enabled on a given level.
Similar changes made in fastcgi/scgi/uwsgi to preserve conf->params
and conf->params_cache.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 14 Oct 2016 19:48:26 +0300 |
parents | 63991ab67b3a |
children | ca27074f8f0f |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_proxy_module.c Fri Oct 14 19:48:26 2016 +0300 +++ b/src/http/modules/ngx_http_proxy_module.c Fri Oct 14 19:48:26 2016 +0300 @@ -3357,6 +3357,20 @@ #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; }