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.

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.

×
2 answers

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

  • Hi, i followed the post and when i run ‘nginx -t’ i get

    nginx: [warn] server name "painelorcaaqui.com.br/ has suspicious symbols in etc/nginx/sites-enabled/default:38
    

    I’ve already tried to modify it but always get the same answer.

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

Submit an Answer