I have an Nginx server block that handles requests and simply serves files from a directory. However, even though the file index.html
exists, it does not serve it, not at /
nor at /index.html
. This problem also occurs for files that I know to exist in the site root directory.
server {
root /var/www/mysite/html/;
index index.html index.htm index.nginx-debian.html;
server_name example.com;
location / {
try_files $uri $uri/ = 404;
}
}
example.com
should simply load the contents of index.html
, but it does not.
access.log
anderror.log
to the question?access.log
norerror.log
were relevant to the issue I was having. I fixed it at the time, but I seem to have forgotten what the solution was now. I will post the solution if I remember/find it. All I remember is that it was within this file (/etc/nginx/sites-enabled/whatever
). (it may have been that extra curly bracket at the end)