nginx proxy nodejs, pm2 startup reports 502 error
PHP中文网
PHP中文网 2017-05-27 17:45:06
0
2
1113

Use nginx proxy: port 3000

normal

npm start

can access

But use

pm2 start app.js

will report error 502

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
给我你的怀抱

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template