先贴一下配置代码:
nginx:
server {
listen 80;
server_name rpc.testweb.net;
index index.php index.html index.htm ;
root /data1/htdocs/www/rpc.testweb.net/;
location / {
index index.php index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root html;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
$document_root,$fastcgi_script_name 这两个变量我打印出来了,路径跟我代码路径一致,
代码路径下的文件 也都是 777 权限了,还有哪里有问题?
nginx,php都是用nobody用户运行的
访问提示
File not found.
好,我改一下配置,把script_filename 直接改为我的地址,访问还是 FILE NOT FOUND
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /data1/htdocs/www/rpc.testweb.net/index.php;
include fastcgi_params;
}
这是什么问题?
扬帆大鱼
呼啦一阵风