﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
754	add_header not being inherited by named location	Neil Craig		"Hi

I am developing an service based on nginx which uses it as a reverse proxy - similar to a CDN. My usage involves using the include config method from nginx to include several ""listeners"" (which in turn include some layer 7 routes - locations). My listeners include a named location which error pages are pointed at via:

error_page 400 =400 @default_error_pages;

location  @default_error_pages {
...
}

I came across what I believe is a bug this morning wherein the add_header methods used as global header setters in nginx.conf are not issued by requests which are served by my named location - even when I used the ""always"" flag - e.g. add_header ""Some-Header"" ""Some value"" always;. I haven't checked it out in huge detail but it may be that add_header isn't working at all in my named location.

I can work around the issue by using more_set_headers as I have this compiled in.

Happy to check things out if it'd be any use.

Neil"	defect	closed	minor		nginx-core	1.7.x	worksforme	add_header header		Linux ip-10-13-145-14.eu-west-1.compute.internal 2.6.32-504.16.2.el6.x86_64 #1 SMP Wed Apr 22 06:48:29 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux	"nginx version: nginx/1.7.12
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) 
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/current/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=gtmdaemon --group=gtmdaemon --with-http_perl_module --with-http_realip_module --with-http_spdy_module --with-http_ssl_module --with-http_sub_module --with-http_geoip_module --with-file-aio --with-pcre-jit --with-ipv6 --add-module=/tmp/tmpNRGtDs/BUILD/nginx-1.7.12/headers-more-nginx-module --add-module=/tmp/tmpNRGtDs/BUILD/nginx-1.7.12/naxsi/naxsi_src --add-module=/tmp/tmpNRGtDs/BUILD/nginx-1.7.12/ngx_cache_purge --add-module=/tmp/tmpNRGtDs/BUILD/nginx-1.7.12/nginx-statsd --add-module=/tmp/tmpNRGtDs/BUILD/nginx-1.7.12/nginx_upstream_check_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'"
