add_header isn't taking effect

Michael Shadle mike503 at
Sat Aug 18 23:31:54 UTC 2012

It actually seems like if I add_header in one scope somewhere it will
ignore in another.

For example I have one gratuitous add_header at the server {} level -
with a different name.

Then I add one on the location level.

Then I have one come from the upstream.

I could reproduce it reliably by adding an add_header somewhere and it
would drop the other one out. I also have two environments with nearly
exact configurations and one passes all 3 headers I want vs. 2 headers
consistently. Very odd.

On Sat, Aug 18, 2012 at 4:04 PM, Francis Daly <francis at> wrote:
> On Sat, Aug 18, 2012 at 03:44:05PM -0700, Michael Shadle wrote:
> Hi there,
>> This block basically works like a charm, passes the upstream headers
>> from proxy_pass_header as expected, but the add_header doesn't seem to
>> work no matter what. add_header is what I use upstream to add the
>> headers like X-Hostname-Proxy.
> It seems to work for me. Perhaps my test case is not the same as your
> test case.
> What request do you make; what response do you get; and what response
> do you expect to get?
>         f
> --
> Francis Daly        francis at
> _______________________________________________
> nginx mailing list
> nginx at

More information about the nginx mailing list