nginx:*21 FastCGI sent in stderr: "Primary script unknown"
阿新 • • 發佈:2019-01-27
linux 下php-fpm+nginx 瀏覽器訪問php頁面,報file not found
後臺nginx 報錯:*21 FastCGI sent in stderr: "Primary script unknown"
可能的原因是:
location ~ ^/.*\.php$
這段中,用alias代替了root
修改前:
location ~ ^/.*\.php$ {
alias /usr/share/nginx/xxxxxx;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
修改後:
location ~ ^/.*\.php$ {
root /usr/share/nginx/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}