My NGINX conf file looks like this:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name site.com;
root /root/mysite;
resolver 8.8.8.8;
location / {
try_files $uri /index.html =404;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
This configuration gives me 404 error. But why? This directive try_files $uri /index.html =404; should try file and if not exist fallback to 404 error.
But I do have a file in root directory.