Odoo 502 Bad Gateway after Restoring Droplet

Posted November 30, 2021 210 views

Just restored a droplet with Odoo utlizing Postgresql. I’m also using Nginx to redirect my URL to the server. Unfortunately, now I am getting the message “502 Bad Gateway nginx/1.18.0 (Ubuntu) ” I have spent all day trying to find resources online testing a host of solutions. Nothing has worked as of yet.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @Euler314,

Most often than not when you see a “502 Bad Gateway nginx” error it’s related to your Application rather than Nginx. Having said that, you can always check your error logs and see the exact error so you know what to search and how to troubleshoot.

First, I’ll suggest checking the error log of your Nginx service. Usually it can be found in /var/log/nginx/error.log or /var/log/nginx/error_log. In can tail the log and see what’s going on. It should suggest where in your application to look.

If this doesn’t work, check the error log of your application. It should also provide you with a more precise error that just searching for a 502 Bad Gateway.

  • Thank you KFSys.

    I went into the nginx error.log via /var/log/nginx/error.log Below was the print.

    021/11/30 07:04:15 [notice] 1542#1542: signal process started
    2021/11/30 07:04:30 [notice] 2182#2182: signal process started
    2021/11/30 07:04:32 [notice] 2184#2184: signal process started
    2021/11/30 07:04:33 [notice] 2193#2193: signal process started

    I’m not sure how to interpret this. I’m new at this obviously. Thank you for your help.

    • Hi @Euler314,

      This error does not tell us anything sadly and I’m not sure it’s even related to the 502 you are getting.

      Can you try tailing the log like so in your terminal:

      tail -f /var/log/nginx/error.log

      hit enter a couple of times to generate new lines and then reload your website, what do you see?