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?


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

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.


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