Use nginx proxy: port 3000
normal
npm start
can access
But use
pm2 start app.js
will report error 502
认证0级讲师
It turns out it’s because
Express 4.x separates the startup module into ./bin/www by default
Open the bin folder directly, then pm2 start www and it’s done
Source
PM2 has multiple startup methods, one of which can be configured as a startup script in a json file. When starting, pm2 start xxx.json, you can check this out on the official wiki
It turns out it’s because
Express 4.x separates the startup module into ./bin/www by default
Open the bin folder directly, then pm2 start www and it’s done
Source
PM2 has multiple startup methods, one of which can be configured as a startup script in a json file. When starting, pm2 start xxx.json, you can check this out on the official wiki