Why is NGINX serving a 404 here?

I have a pretty standard test nginx configuration file
(/etc/nginx/sites-available/default) that was configured to serve a
html document.

Here’s the modified portion of the configuration file.

upstream auth{

server {
listen 80 default_server;

    root /var/www/index.html;

    # Make site accessible from http://localhost/
    server_name _;

    location / {
            try_files $uri $uri/ =404;

    location /auth{
            proxy_pass http://auth;


And yet, accessing my machine’s IP address seems to return a 404. What’s
going on here?

I’ve ensured that the permissions of index.html ensure that the file is
readable, so doesn’t seem to be a permissions issue.

Posted at Nginx Forum:

Just a quick look but I noticed this:

root /var/www/index.html

I guess you wanted root /var/www/ !?

Also looking at the logs should probably hint on why the 404 is
but I’m guessing its realted to the above line :slight_smile:

Melhores Cumprimentos // Best Regards

Miguel C.
IT - Sys Admin & Developer

On Mon, Aug 31, 2015 at 1:54 AM, maplesyrupandrew [email protected]

Thanks for the response! I made that change, and I think what was really
giving the 404 was that I had changed permissions on the index.html
but not on the var/www/ folder, which I needed so that the nginx user
could access it. Thanks!

Posted at Nginx Forum: