问题描述:
项目代码更新之后去接口访问出现了502的错误;
一开始以为是nginx配置出错了,但一想没有改动里面的配置;
然后敲了一下pm2 list命令,看看启动的情况,发现在status那一栏是errored;
pm2 logs www日志
Nginx error.log
2024/05/28 02:00:38 [error] 15003#0: *3531770 connect() failed (111: Connection refused) while connecting to upstream, client: 125.111.47.152, server: _, request: "GET /mgzapi/userOOTD/all HTTP/1.1", upstream: "http://127.0.0.1:5050/mgzapi/userOOTD/all", host: "biguden.cn:5000", referrer: "https://servicewechat.com/wxc47531ec5d63e70/devtools/page-frame.html"
2024/05/28 02:00:38 [error] 15003#0: *3531770 connect() failed (111: Connection refused) while connecting to upstream, client: 125.111.47.152, server: _, request: "POST /mgzapi/userOOTD/month HTTP/1.1", upstream: "http://127.0.0.1:5050/mgzapi/userOOTD/month", host: "biguden.cn:5000", referrer: "https://servicewechat.com/wxc47531ec5d63e70/devtools/page-frame.html"
2024/05/28 02:00:38 [error] 15003#0: *3531770 connect() failed (111: Connection refused) while connecting to upstream, client: 125.111.47.152, server: _, request: "GET /mgzapi/banner/opening/1/1 HTTP/1.1", upstream: "http://127.0.0.1:5050/mgzapi/banner/opening/1/1", host: "biguden.cn:5000", referrer: "https://servicewechat.com/wxc47531ec5d64e70/devtools/page-frame.html"
2024/05/28 02:00:39 [error] 15003#0: *3531770 connect() failed (111: Connection refused) while connecting to upstream, client: 125.111.47.152, server: _, request: "GET /mgzapi/wechat/getOpenid/0d3RL2s6twd4jnl2OHous0RL5l- HTTP/1.1", upstream: "http://127.0.0.1:5050/mgzapi/wechat/getOpenid/0d3RL2s6twdjiynl2OHous0RL5l-", host: "biguden.cn:5000", referrer: "https://servicewechat.com/wxc47531ec5d6370/devtools/page-frame.html"
pm2 show www
求解,万谢
是不是你的 node 代码报错了,导致 pm2 进程出错