Home  >  Q&A  >  body text

nginx proxy nodejs, pm2 startup reports 502 error

Use nginx proxy: port 3000

normal

npm start

can access

But use

pm2 start app.js

will report error 502

PHP中文网PHP中文网2701 days ago1077

reply all(2)I'll reply

  • 给我你的怀抱

    给我你的怀抱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

    reply
    0
  • 世界只因有你

    世界只因有你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

    reply
    0
  • Cancelreply