nginx错误收集

1、错误:

recv() failed (104: Connection reset by peer) while reading response header from upstream

可能的原因:

(1)php进程不够用。主要涉及php-fpm配置中的max_childre等参数的设置。详细内容参考阿里云Linux CentOS8.1 64位服务器安装LNMP(Linux+Nginx+MySQL+PHP) 并发调试之php-fpm配置及其与Nginx的通信

2、错误:
成功启动nginx和php-fpm后,访问php,控制台报错:File not found,同时在Nginx的错误日志中有FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream
原因是php-fpm进程找不到SCRIPT_FILENAME配置的要执行的.php文件,php-fpm返回给Nginx的默认404错误提示。
解决方法是,把SCRIPT_FILENAME的配置fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
改为fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
如果还是不行,直接改为具体路径fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;

每一次的结束都意味着新的开始
原文地址:https://www.cnblogs.com/ccdv/p/14319873.html