In your default config file, you have to specify default_server
on both listen
lines; also, you need to remove the server_name
line:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/website;
index index.html index.htm;
#server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
}
}
The underscore that you are using for the server_name
is not actually a wild card (if that was your intent). From the nginx Server Names documentation:
There is nothing special about this name, it is just one of a myriad of invalid domain names which never intersect with any real name. Other invalid names like “--” and “!@#” may equally be used.