[英]cound't start express app using pm2
I do nodemon it's fine but too bad nodemon isn't restart the app when something happened.我做 nodemon 很好,但太糟糕了 nodemon 在发生某些事情时没有重新启动应用程序。
Where's what i've tried in my ubuntu server :我在 ubuntu 服务器中尝试过的内容是什么:
npm install pm2 -g
pm2 start app.js
pm2 start app.js
pm2 startup ubuntu
My app still has 502 bad gateway error.我的应用程序仍然有 502 bad gateway 错误。 Sigh why does this happens?
咳咳,为什么会这样? I do
nodemon
it's running.. Strange thing is in the terminal pm2 did show an app and it's online :(我做
nodemon
它正在运行..奇怪的是在终端 pm2 确实显示了一个应用程序并且它在线:(
1) Check if your application is listed in PM2, use the command pm2 list
1) 检查你的应用程序是否在 PM2 中,使用命令
pm2 list
2) Running apps should be listed, you can either find an online
or errored
status for each app 2)应列出正在运行的应用程序,您可以找到每个应用程序的
online
或errored
状态
3) If your app is online
, try to curl localhost:port
( if this works, something is wrong with your firewall or nginx / apache configuration) 3)如果您的应用程序
online
,请尝试curl localhost:port
(如果可行,则说明您的防火墙或 nginx / apache 配置有问题)
4) If it is errored
, please check pm2 log - ~/.pm2/pm2.log ' 4)如果
errored
,请检查日志PM2 - 〜/ .pm2 / pm2.log“
如果 pm2.log 显示“...有太多不稳定重启...”,请尝试解决方案https://stackoverflow.com/a/30651668/3054511
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.