proxy_set_header inheritance not working?
    Mark Reginald James 
    mrj at bigpond.net.au
       
    Fri Mar 28 09:57:18 MSK 2008
    
    
  
Hi,
To prevent duplication between ssl and non-ssl configs
I wanted to do this:
server {
   listen 80;
   include common.conf;
}
server {
   listen 443;
   ssl on;
   proxy_set_header X_FORWARDED_PROTO https;
   include common.conf;
}
where common.conf has a "location /" block that has
its own proxy_set_header directives.
I'm finding that in 0.5.35 the X_FORWARDED_PROTO won't be
set using this arrangement.
The English proxy_set_header docs state
   "This directive is inherited from the previous level when at this
    level are not described their directives proxy_set_header."
   http://wiki.codemongers.com/NginxHttpProxyModule#proxy_set_header
Is this saying in a lost-in-translation way that inheritance
only happens when there are no proxy_set_header directives at
the lower level?  This may be the case, because I've managed to
get this common include arrangement working when the proxy_set_header
directives in the include file are moved from "location /" to
the top level of the file (which is at the server level).
-- 
We develop, watch us RoR, in numbers too big to ignore.
    
    
More information about the nginx
mailing list