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

Edho Arief edho at myconan.net
Fri Feb 3 18:48:19 UTC 2012


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?


Additionally:

Is there any variable I can use for my case? $request_filename
returned "/opt/nginx/" (bug?). Or do I have use separate block when
using alias (ie. nothing is inherited when using alias)?

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



More information about the nginx mailing list