nginx故障 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.1.101, server: localhost, request:

2914人浏览 / 0人评论

php文件无法解析,

经过查询后是nginx内置变量问题

原问题:

修改后:

1

fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;

而Nginx识别不到/scripts路径,所以phpinfo验证信息就无法正常通过,需要修改如下:

1

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

 

 

进行检查重启:

好了

 

https://www.v2ex.com/t/341441

try_file是确认用户访问的文件是否存在,如果不存在就返回后面的值。

location / {
try_files $uri @java_page;
}
location @java_page {
proxy_pass http://127.0.0.1:8080;
}

[root@nfs1 conf.d]# cat default.conf 
server {
    listen       80;
    server_name  localhost;
    root /opt/qianbnao/qianbao/yuanma/;
    index  index.php index.html index.htm;

location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

全部评论