Website stopped working

October 30, 2019 137 views
DigitalOcean

My website has suddenly stopped working. Generates error “502 Bad Gateway nginx / 1.10.3 (Ubuntu)”. Can someone help me? What can it be?

1 comment
  • Without knowing your system configuration there could be a number of reasons why you will be getting this error. The first I typically look at is if all required services are running.

    This could be a back-end service NGINX is talking to is no longer able to be reached such as PHP-FPM. An example command to check is:

    sudo service phpX.X-fpm
    

    replace X.X with your PHP version number.

    If you recently performed an apt upgrade of the server, check that any configuration file(s) were not overwritten.

    You will also want to ensure the proper ownership and permissions are set for you website file(s) and directories.

    A good start can be found here https://www.datadoghq.com/blog/nginx-502-bad-gateway-errors-php-fpm/

1 Answer

Hello,

In addition to what jasonjpeters mentioned, I would recommend first checking your Nginx error log. You could do that with the following command:

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

There you should find the exact error that is actually causing the problem rather than the generic 502 error.

Hope that this helps!
Regards,
Bobby

Have another answer? Share your knowledge.