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

Edho Arief edho at myconan.net
Fri Feb 3 18:50:55 UTC 2012


On Sat, Feb 4, 2012 at 1:48 AM, Edho Arief <edho at myconan.net> wrote:
> On Sat, Feb 4, 2012 at 1:10 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:
>>
>> Yes, this is expected behavrious.  Rewrite module directives are
>> never inherited, and directives specified inside location are only
>> executed if this exact location matches.
>>
>> See here for details:
>> http://nginx.org/en/docs/http/ngx_http_rewrite_module.html
>>
>
> I replaced the line:
>
>      -fastcgi_param SCRIPT_FILENAME $userfile;
>      +fastcgi_param SCRIPT_FILENAME /home/edho/public_html/test.php;
>
>
> But I still see this:
>
> 2012/02/03 13:30:16 [warn] 12889#0: *17 using uninitialized "userfile"
> variable, client: 118.136.36.164, server: localhost, request: "GET
> /~edho/test.php HTTP/1.1", host: "yutsuki.myconan.net"
>
> Why did I get warning for using uninitialized variables even though
> it's not specified at all in the relevant location block?
>

After a bit more thinking, does it mean that the "alias $userfile"
from parent location block was inherited but the $userfile was passed
literally?


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



More information about the nginx mailing list