早上启动服务后,发现项目访问不了;
重启和重新配置域名都没反应;
查看nginx错误日志发现这个问题
2020/10/12 10:16:27 [error] 7644#6360: *1 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:8002"
2020/10/12 10:16:27 [error] 7644#6360: *1 CreateFile() "D:/wnmp/nginx/html/www.daifatu.com/public/50x.html" failed (2: The system cannot find the file specified), client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:8002"
杀掉windows 9000端口进程就好了
打开cmd命令
netstat -aon|findstr "9000"
taskkill /pid 子进程码 -t -f
本文记录了一次Nginx服务出现upstream过早关闭连接的问题排查过程,通过检查错误日志定位到fastcgi连接失败的原因,并给出了通过结束Windows上占用9000端口的进程来解决问题的方法。

被折叠的 条评论
为什么被折叠?



