# Proxy\_pass\_header precedence over proxy\_hide\_header

**URL:** <https://www.ruby-forum.com/t/proxy-pass-header-precedence-over-proxy-hide-header/204875>\
**Category:** NGINX\
**Created:** [March 23, 2011, 8:02pm UTC](https://www.ruby-forum.com/t/proxy-pass-header-precedence-over-proxy-hide-header/204875 "2011-03-23T20:02:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 23, 2011, 8:02pm UTC](https://www.ruby-forum.com/t/proxy-pass-header-precedence-over-proxy-hide-header/204875/1 "2011-03-23T20:02:00Z")

</div>

Hi Everyone,

I just spent a lot of time fighting with a misterious problem with the  
cache in one of our nginx servers.  
Problem was found and thought it would be nice to share what happened  
with everyone else so no one get into the same hole I went.

We have a file with all default proxy configuration which we include  
in all our proxy\_cache setups, then we only use the proxy directives  
we need to change inside each site or location.

So if you globally set proxy\_pass\_header to allow cookies to go out  
and then you want one location to don’t pass cookies,  
proxy\_hide\_header Set-Cookie won’t be enough, cookies will pass  
anyway.

The fix is to put proxy\_pass\_header off; before proxy\_hide\_header  
Set-Cookie inside the location.

Hope it helps someone else…

Cheers from Uruguay
