I'm trying to set up a test server block using nginx. I've tried many ways, but test.myserver.com always shows me a 404. My goal is to be shown the index.html in /var/www/test/html/index.html.
This is what I have so far:
server {
listen 80;
listen [::]:80;
# SSL configuration
#
listen 443 ssl;
listen [::]:443 ssl;
root /var/www/test;
index index.html index.htm index.nginx-debian.html;
server_name test.myserver.com www.test.myserver.com;
location ^~ /html {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files index.html $uri $uri/ / =404;
}
location / {
index /html/index.html;
}
As you can see, I'm trying to different ways already. I got the idea with the ^~ folder location from here.
So: why is nginx giving me 404s and how would I fix that?