Include and variable settings

Hello,

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?

Thanks!

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

client_body_buffer_size 128k;

nginx.conf/0.6.29

    location ~ ^/wiki/ {

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs