Welcome! Log In Create A New Profile

Advanced

Is this how variable (set $var) inheritance works?

Edho Arief
February 03, 2012 10:28AM
(doesn't seem to be specified in documentation)

My test showed:
- anything set in server { } block is inherited:

server {
set $something /usr/share/something;
...
location / {
location /nested/ {
# $something is set to /usr/share/something
root $something;
}
}
}

- anything set in location { } block is not inherited:

server {
...
location /~ {
location ~ ^/~([^/]+)(|/.*)$ {
set $userfile /home/$1/public_html/$2;
alias $userfile;
location ~ \.php$ {
include fastcgi_params;
# $userfile is empty here
fastcgi_param SCRIPT_FILENAME $userfile;
fastcgi_pass 127.0.0.1:9000;
}
}
}



Is it correct?


--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Is this how variable (set $var) inheritance works?

Edho Arief February 03, 2012 10:28AM

Re: Is this how variable (set $var) inheritance works?

Maxim Dounin February 03, 2012 01:12PM

Re: Is this how variable (set $var) inheritance works?

Edho Arief February 03, 2012 01:50PM

Re: Is this how variable (set $var) inheritance works?

Edho Arief February 03, 2012 01:52PM

Re: Is this how variable (set $var) inheritance works?

Edho Arief February 03, 2012 02:00PM

Re[2]: Is this how variable (set $var) inheritance works?

Max February 03, 2012 08:16PM

Re: Re[2]: Is this how variable (set $var) inheritance works?

Edho Arief February 03, 2012 09:54PM

Re: Re[2]: Is this how variable (set $var) inheritance works?

António P. P. Almeida February 03, 2012 10:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 155
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready