日期:2014-05-17  浏览次数:20449 次

nginx服务器下访问不存在的php页面No input file specified.
在nginx/conf/nginx.conf   找到:
fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;  改为:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;


http://apps.hi.baidu.com/share/detail/31677987
http://www.oschina.net/question/57933_27069




nginx服务器下访问不存在的非php页面,可以正常出现自定义的404提示页,但是访问不存在的php页面,页面信息显示
初步估计是fastcgi没把错误给Nginx
查了下nginx的文档 果然
fastcgi_intercept_errors
syntax: fastcgi_intercept_errors on|off
default: fastcgi_intercept_errors off
context: http, server, location 
默认的是off

只需在虚拟主机配置文件加入:
fastcgi_intercept_errors on;

即可。我配置了error_page 404,没有使用nginx默认的404提示页面。
效果图:



配置文件里面的编写