502 Bad Gateway After Reboot

November 5, 2019 159 views
DigitalOcean Ubuntu 18.04

Hi DO Team,

My droplets is working good before i power off for a long time ( 2 week ), and today i’m trying to power on my droplet, it show 502 Bad Gateway in the browser. And in the terminal when i’m trying to run pm2 restart server.js, it show … Use –update-env to update environments variables....
I dont know how to fix it and make my server run again ( try to run pm2 start server.js –update-env but it not work..).
Note: i’m using Nodejs + MongoDb + Nextjs and server is Ubuntu 18.04.
Thank you.

1 Answer


The problem that you are seeing is not really related to a droplet problem, it is definitely due to your application not running at the moment.

I would recommend starting with the following:

  • Check your Nginx error log for more information:
tail -100 /var/log/nginx/error.log

Feel free to share the error here so I could advise you further.

  • Share the error that you get when you try to start your application.


Have another answer? Share your knowledge.