Mercurial > hg > nginx
comparison 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 |
comparison
equal
deleted
inserted
replaced
6746:63991ab67b3a | 6747:20eb4587225b |
---|---|
3355 } | 3355 } |
3356 } | 3356 } |
3357 | 3357 |
3358 #endif | 3358 #endif |
3359 | 3359 |
3360 /* | |
3361 * special handling to preserve conf->headers in the "http" section | |
3362 * to inherit it to all servers | |
3363 */ | |
3364 | |
3365 if (prev->headers.hash.buckets == NULL | |
3366 && conf->headers_source == prev->headers_source) | |
3367 { | |
3368 prev->headers = conf->headers; | |
3369 #if (NGX_HTTP_CACHE) | |
3370 prev->headers_cache = conf->headers_cache; | |
3371 #endif | |
3372 } | |
3373 | |
3360 return NGX_CONF_OK; | 3374 return NGX_CONF_OK; |
3361 } | 3375 } |
3362 | 3376 |
3363 | 3377 |
3364 static ngx_int_t | 3378 static ngx_int_t |