Question

404 not found nginx

I rebooted my server and got 404 not found nginx page when trying to access my website. Before the reboot it was working fine, but i dont know what happened.


Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Nginx responds with 404 when the page requested is not found.

It is very unlikely that document roots of websites configured disappeared to cause missing files. However, it is worth checking if the original document root and files are still there.

If the document root of the website still there,

it is likely that a backend service responsible for processing pages for nginx is not running.

Example of such services includes apache, php-fpm, node etc.

It is of course very easy to happen such a case as many people will forget to configure services to start on boot.

So, it is likely that apache, php-fpm or node failed to stat after boot causing such an issue.

if that is the case, start such a service and configure that service to start on boot as below.

centos 6: chkconfig service_name on

centos 7: systemctl enable service_name

Hello,

I would recommend following the steps from this article on how to troubleshoot common Nginx problems:

https://www.digitalocean.com/community/questions/how-to-troubleshoot-common-nginx-issues-on-linux-server

If you are still seeing the error, feel free to share the output from your logs here so that I could try to further advise.

Regards, Bobby