include and variable settings

Igor Sysoev is at rambler-co.ru
Fri Apr 11 18:56:38 MSD 2008


On Fri, Apr 11, 2008 at 12:07:19AM -0700, Adam Zell wrote:

> 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 {
>         listen       127.0.0.1:443;
>         server_name  wiki.foo.com;
> 
>         access_log  logs/wiki.ssl.access.log  main;
>         rewrite     ^/$  $scheme://$server_name/wiki/  redirect;
> 
>         ssl  on;
> 
>         location ~ ^/wiki/ {
>             proxy_pass        http://1.2.3.4:80;
>             proxy_redirect    http://wiki.foo.com/  /;
>             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?

No way.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list