<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">I also think CodeIgniter needs the PATH_INFO environment variable set.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">
<br>Moreover, <a href="https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-and-nginx-dont-trust-the-tutorials-check-your-configuration/">there is a potential security breach in your current configuration</a>.<br></div>
<div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">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 <a href="http://trac.nginx.org/nginx/ticket/321">using try_files with fastcgi_split_pathinfo wreaks havoc (that *won't fix*, not a bug... oO)</a>, 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">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></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">
Hope I helped,<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 4:31 PM, Anoop Alias <span dir="ltr"><<a href="mailto:anoopalias01@gmail.com" target="_blank">anoopalias01@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Perhaps this didnt work for you because you have <div><br></div><div>root /var/www/example/;<br></div><div><br></div><div>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</div>
<div class="">
<div class="gmail_extra"><div class="gmail_quote"><br></div><br clear="all"><div><br></div>-- <br><b>Anoop P Alias</b> <div><a href="http://gnusys.net" target="_blank">GNUSYS</a></div>
</div></div></div>
<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></blockquote></div><br></div></div>