add_header is not working in certain locations

bodomic nginx-forum at
Thu Aug 14 12:50:07 UTC 2014

Hi Francis, 

Thanks for your thoughtful entry. It seems that it is a cloudy area of buggy
'if' behaviors :)
I've created empty host config with just 'location /' and 'if ...
add_header' and proxy_pass - and it works fine.
I'll have to retest this situation on my real server though to find out if
my 'issue' is gone.

As for the second case - yes, it looks like the whole set of so I think that's the case of buggy
behavior too.
I'll try the 'What to do instead' section. But, funny to notice, in my case
try_files *does* work, while 'if' does not in the same location.

Config of Nginx for Drupal is here:
I'm using it literally from there, just trying to add a buggy 'if' here and

Posted at Nginx Forum:,252523,252571#msg-252571

More information about the nginx mailing list