Include order and variables definition in configuration

Maxim Dounin mdounin at
Mon Feb 24 23:42:36 UTC 2014


On Mon, Feb 24, 2014 at 11:39:39PM +0100, B.R. wrote:

> Hello,
> I am considering the following configuration:
> server {
>     include fastcgi.conf # Default configuration coming with a Debian
> package which contains a definition of the SCRIPT_FILENAME FastCGI variable
> with $document_root$fastcgi_script_name as its value
> ...
>     location ~^/index\.php {
>         fastcgi_split_path_info ^(/index\.php)(/.*)$;
>     }
> }
> ​Will the FastCGI SCRIPT_FILENAME variable value take into account the
> value of $fastcgi_script_name after fastcgi_split_path_info has been called
> or will it be resolved when the fastcgi.conf file is included?

Variables are evaluated at runtime only, during processing of a 
request.  And the $fastcgi_script_name variable will use 
fastcgi_split_path_info as found in a location where the variable 
is used - that is, in a location where fastcgi_pass happens.

Maxim Dounin

More information about the nginx mailing list