proxy_set_header at http level
clanherb at gmail.com
Thu Jan 6 17:23:45 MSK 2011
Thanks. I did some tests:
(A) Set X-AAA at http level and do nothing at server level.
(B) Set X-AAA at http level and set X-BBB at server level.
Only X-BBB is set and sent to backend.
So the inheritance mechanism of proxy_set_header works in a All-None mode.
If there is any directive set at a smaller block, all the values set by
bigger block are cancelled.
Is it possible to change this behavior to the normal inheritance mechanism
so setting directive at smaller block only cancel the same directive at
On Thu, Jan 6, 2011 at 1:09 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> On Wed, Jan 05, 2011 at 10:42:09PM +0800, 杨镭 wrote:
> > Hi all,
> > Although the documentation (
> > http://wiki.nginx.org/HttpProxyModule#proxy_set_header) says the context
> > proxy_set_header can be http, server, location，we found that
> > proxy_set_header directive at http level does not work. When moved to
> > level, everything works fine.
> > Setting proxy_set_header at http level allows us to centralize some
> > settings thus avoid manually copy those directives to each virtual host
> > it was created. e.g., we use X-Http-Scheme header to let backend server
> > if it's a https request, otherwise they can't know.
> It works at http level just fine. Most likely you've defined
> proxy_set_header at server level as well, and this cleared
> values set on http level. Note the following in wiki:
> % proxy_set_header directives issued at higher levels are only
> % inherited when no proxy_set_header directives have been issued at
> % a given level
> Maxim Dounin
> nginx mailing list
> nginx at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx