Welcome! Log In Create A New Profile

Advanced

multiple add_header directives in different contexts

Andrew Benton
October 17, 2011 01:54AM
so i have a configuration like this:

....
http {
...
add_header X-Bleep bloop;
server {
...
add_header X-Foo bar;
}
server {
...
}
}

and only "X-Bleep: bloop" is showing up in responses. is this expected
behavior? is there any way to have multiple add_header directives in
separate contexts work as i would expect? that is, every response
includes "X-Bleep: bloop" but only requests matching the first server
block should have "X-Foo: bar" as well?

i know i could add the first add_header directive to every server
block, but i have a lot of server blocks and this header may have to
change so it would be a maintenance nightmare.

thanks for your help!

amb

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

multiple add_header directives in different contexts

Andrew Benton October 17, 2011 01:54AM

Re: multiple add_header directives in different contexts

agentzh October 17, 2011 03:02AM

Re: multiple add_header directives in different contexts

Andrew Benton October 17, 2011 03:38AM

Re: multiple add_header directives in different contexts

agentzh October 17, 2011 09:22AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 168
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready