微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Nginx-FastCGI-"Primary script unknown" while reading response header from upstream,

在对Nginx添加fastCGI的支持后,然后进行PHP页面验证,居然报错File not found,查看日志显示

FastCGI sent in stderr: "Primary script unkNown" while reading response header from upstream,

一开始以为是权限问题,先上配置

location  ~ \.PHP$ {
          root  /data/Nginx/html/PHP;
          default_type text/html;
          fastcgi_pass  127.0.0.1:9000;
          fastcgi_index  index.PHP;
          #fastcgi_param  SCRIPT_FILENAME /data/Nginx/PHP$fastcgi_script_name;
          fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;   //有问题的一行
          fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
          include  fastcgi_params;
       }

看起来配置是一样的,其实这里有个天坑,我是直接复制win到linux的,,使用Nginx -t文件是OK的,完全检测不出来,令人摸不到头绪,可以下载WinMerge文件对比一下上下两行,也可以cat -A检测win空格。

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐