Question

Website stopped working

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

Subscribe
Share

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/


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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