0
我的問題我很簡單。Nginx + php fastcgi顯示「沒有指定輸入文件」。而不是404
當我請求一個不存在的.php文件時,我看到「沒有指定輸入文件」,而不是你期望的404頁面。
我得到,我所有的請求都通過.php擴展名傳遞給php-fpm,我猜php-fpm返回「沒有指定輸入文件」。當文件不存在時(?)。 我該如何解決這個問題?
/etc/nginx/nginx.conf:
http {
server {
listen 443 ssl;
server_name smarthome.dk;
ssl_certificate /home/www/SmartHome/cert/ssl.crt;
ssl_certificate_key /home/www/SmartHome/cert/ssl.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
keepalive_timeout 70;
root /home/www/SmartHome/public_html;
index index.php index.html;
location/{
try_files $uri $uri/ /404.php?$args;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
}
我在/etc/php5/fpm/php.ini cgi.fix_pathinfo = 0;
。
接受您的答案以關閉查詢 – Dayo
@Dayo您必須等待2天,然後才能接受自己的答案。 –