Hello.<br><br>You shoude set (fastcgi_param SCRIPT_FILENAME) .<br><br>example:<br> location ~ .*\.(php|php5)?$<br>
{<br>
fastcgi_param SCRIPT_FILENAME /data/web/$1;<br>
<br>
}<br><br><br><div class="gmail_quote">On Wed, Sep 28, 2011 at 10:56 AM, baalchina <span dir="ltr"><<a href="mailto:nginx-forum@nginx.us">nginx-forum@nginx.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello everyone,<br>
<br>
I am working on an centos6 with nginx 1.0.6, php 5.3.6, and fpm.<br>
<br>
I found that php file in my subdirectory returns a 404,but in nginx home<br>
direcory works fine.<br>
<br>
For example , a phpinfo.php file works fine in /data/web/, where<br>
/data/web is my nginx document root. Buy the same file in /data/web/sub,<br>
the browser and nginx both tell a 404 error.<br>
<br>
Here is my nginx config file:<br>
<br>
<br>
server {<br>
listen 80;<br>
server_name <a href="http://abc.example.com" target="_blank">abc.example.com</a>;<br>
<br>
location / {<br>
root /data/web/;<br>
index index.html index.htm index.php;<br>
<br>
location ~ .*\.(php|php5)?$<br>
{<br>
fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br>
fastcgi_index index.php;<br>
include fastcgi.conf;<br>
fastcgi_connect_timeout 300;<br>
fastcgi_send_timeout 300;<br>
fastcgi_read_timeout 300;<br>
fastcgi_buffer_size 64k;<br>
fastcgi_buffers 4 64;<br>
fastcgi_busy_buffers_size 128k;<br>
fastcgi_temp_file_write_size 128k;<br>
}<br>
}<br>
}<br>
<br>
<br>
btw, static file such as html works fine.<br>
<br>
Thans a lot.<br>
<br>
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,215921,215921#msg-215921" target="_blank">http://forum.nginx.org/read.php?2,215921,215921#msg-215921</a><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></blockquote></div><br><br clear="all"><br>-- <br>douban:<a href="http://www.douban.com/people/mustang/" target="_blank">www.douban.com/people/mustang/</a><br>
<br>blog: <a href="http://www.pagefault.info" target="_blank">www.pagefault.info</a><br><br>twitter: <a href="http://www.twitter.com/minibobo" target="_blank">www.twitter.com/minibobo</a><br><br>weibo: <a href="http://www.weibo.com/diaoliang" target="_blank">www.weibo.com/diaoliang</a><br>
<br>