include and variable settings

Adam Zell zellster at
Fri Apr 11 11:07:19 MSD 2008


I would like to set a directive in a common configuration file, and
explicitly override it if need be.  Example:

# proxy.conf
proxy_redirect     off;
proxy_set_header   Host             $host;
proxy_set_header   X-Real-IP        $remote_addr;
proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

client_max_body_size       2m;
client_body_buffer_size    128k;

proxy_connect_timeout      300;
proxy_send_timeout         300;
proxy_read_timeout         300;

proxy_buffer_size          4k;
proxy_buffers              4 32k;
proxy_busy_buffers_size    64k;
proxy_temp_file_write_size 64k;

# nginx.conf/0.6.29
# snippage
    server {

        access_log  logs/wiki.ssl.access.log  main;
        rewrite     ^/$  $scheme://$server_name/wiki/  redirect;

        ssl  on;

        location ~ ^/wiki/ {
            proxy_redirect  /;
            proxy_set_header  X-FORWARDED_PROTO         https;
            include           proxy.conf;

What I would like to happen is for the proxy_redirect in the location{}
section to override the "off" setting in proxy.conf.  Currently this does
not seem to happen.  Moving the include line to the top and the bottom of
the location block doesn't make a difference.  Is there a nice way to do
this other than commenting out the setting in proxy.conf?


zellster at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list