<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Hello Francis and Maxim,<br><br>I understand very well that $fastcgi_script_name value is defined after fastcgi_split_path_info is called.<br>

However I was wondering about other variables which value depend on $fastcgi_script_name, for example when PHP's SCRIPT_NAME has been defined in the already included fastcgi.conf.<br><br>Here are 2 examples:<br>server {<br>

        listen               80;<br>        server_name     <a href="http://b.cd">b.cd</a>;<br>        try_files            $uri $uri/ /index.php$uri;<br><br>        root    /var/www;<br>        index   index.html index.htm index.php;<br>

        include fastcgi.conf;<br>        fastcgi_buffers 8 8k;<br><br>        location ~ ^/index\.php {<br>                fastcgi_split_path_info ^(/index\.php)(/.*)$;<br>                fastcgi_param PATH_INFO $fastcgi_path_info;<br>

                fastcgi_pass unix:/var/run/php5-fpm.sock;<br>        }<br>}<br><br>The previous configuration seems to fail (returns 200 with blank page, no error).<br><br>server {<br>        listen               80;<br>
        server_name     <a href="http://b.cd">b.cd</a>;<br>
        try_files            $uri $uri/ /index.php$uri;<br><br>        root    /var/www;<br>        index   index.html index.htm index.php;<br>        fastcgi_buffers 8 8k;<br><br>        location /favicon.ico {<br>            access_log off;<br>

            log_not_found off;<br>            expires 7d;<br>            return 204;<br>        }<br><br>        location ~ ^/index\.php {<br>                fastcgi_split_path_info ^(/index\.php)(/.*)$;<br>                include fastcgi.conf;<br>

                fastcgi_param PATH_INFO $fastcgi_path_info;<br>                fastcgi_pass unix:/var/run/php5-fpm.sock;<br>        }<br>}<br><br>This configuration, on the other hand, runs smoothly.<br><br>If I get the 'variables are evaluated the first time they are needed' statement, in the first configuration, $fastcgi_script_name was accessed when defining SCRIPT_NAME, thus its value was wrong. Whether or not $fastcgi_script_name value is overwritten in the location block is another story, though.<br>

<br>In the second configuration, $fastcgi_script_name is ensured to be accessed if and only if it been correctly defined by the previous fastcgi_split_path_info directive, ensuring the success of the configuration.<br><br>

Am I right?<br></div><div class="gmail_extra"><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font>
</div></div>