Use nginx proxy: port 3000
normal
npm start
can access
But use
pm2 start app.js
will report error 502
给我你的怀抱2017-05-27 17:47:06
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
世界只因有你2017-05-27 17:47:06
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