<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">If you use try_files with fastcgi_split_path_info, do not try to set PATH_INFO with $fastcgi_path_info directly as it will be empty.<br>

<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">If PATH_INFO is not set (as it might not be required like you point it out) and stick with the $fastcgi_script_name of the split directive, then the PATH_INFO 2-lines trick is indeed useless but the rest is correct and recommended.<br>

</div><div class="gmail_extra"><div><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>
<br><br><div class="gmail_quote">On Tue, Jul 15, 2014 at 7:58 PM, wishmaster <span dir="ltr"><<a href="mailto:artemrts@ukr.net" target="_blank">artemrts@ukr.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class=""><br>
<br>
<br>
 --- Original message ---<br>
 From: "B.R." <<a href="mailto:reallfqq-nginx@yahoo.fr">reallfqq-nginx@yahoo.fr</a>><br>
 Date: 15 July 2014, 19:16:19<br>
<br>
<br>
<br>
><br>
><br>
> I also think CodeIgniter needs the PATH_INFO environment variable set.<br>
<br>
</div>   This is not true, as you can choose of using PATH_INFO, QUERY_STRING, REQUEST_URI and so on, so this tricks with path_info is excessive.<br>
Just use try_files and fastcgi_split_path_info<br>
<div class="im HOEnZb"><br>
><br>
><br>
> Moreover, there is a potential security breach in your current configuration.<br>
><br>
> The recommended way (when using the same machine for front-end and back-end services) it to use try_files to check for the existence of the invoked PHP script. However, since using try_files with fastcgi_split_pathinfo wreaks havoc (that *won't fix*, not a bug... oO), I would recommend patching you PHP location like the following:<br>


><br>
> location ~^ \.php$ {<br>
> # root /var/www/example/; # You should follow Anoop piece of advice<br>
> index index.php;<br>
> fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br>
><br>
> fastcgi_split_path_info ^(.+\.php)(/.*?)$;<br>
> # $fastcgi_script_name is a system path to a file,<br>
> # while $uri is... an URI which might not always correspond to a file<br>
> try_files $fastcgi_script_name =404; # Checking PHP script existence<br>
><br>
> # A trick to go beyond the bug/'feature' using try_files with fastcgi_split_pathinfo<br>
> set $path_info $fastcgi_path_info<br>
> fastcgi_param PATH_INFO $path_info;<br>
><br>
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br>
> include fastcgi_params;<br>
> }<br>
><br>
><br>
><br>
> Hope I helped,<br>
><br>
><br>
> ---<br>
> B. R.<br>
><br>
><br>
</div><div class="HOEnZb"><div class="h5">> On Tue, Jul 15, 2014 at 4:31 PM, Anoop Alias wrote:<br>
><br>
Perhaps this didnt work for you because you have <br>
<br>
<br>
root  /var/www/example/;<br>
<br>
<br>
<br>
in the php location . Move up the root in location / to the server {}  level and delete the root from php location . This is also the best approach as per nginX docs<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
Anoop P Alias <br>
GNUSYS<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
<br>
<br>
><br>
> _______________________________________________<br>
> nginx mailing list<br>
> <a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
> <a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a></div></div></blockquote></div><br></div></div>