Getting a 404 error message from Nginx

I'm getting a 404 message for my website and I'm not sure what's causing this. How do I check and fix this?

1 Reply

I would check the virtual host file for your domain and verify that the "root" path is pointing to the directory where your website files exist. For example, here's an entry from my website's virtual host file:

root /var/www/public_html/test_server;

You can also test your Nginx configuration using the following command:

nginx -t

We also have a few guides that you can reference regarding Nginx and how it's configured. I've provided some links for your reference:
https://www.linode.com/docs/web-servers/nginx/how-to-configure-nginx/#location-blocks
https://www.linode.com/docs/web-servers/nginx/nginx-installation-and-basic-setup/#set-your-site-s-root-directory

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct