Refactor duplicate config and add robots.txt location

This commit is contained in:
Daniel_I_Am 2022-05-26 14:00:55 +02:00
parent 447cbefc5f
commit ef5dc8116a

View File

@ -2,14 +2,21 @@ server {
listen 80 default_server; listen 80 default_server;
listen [::]:80 default_server; listen [::]:80 default_server;
location / { root /var/www/html;
root /var/www/html; index index.html;
index index.html;
try_files $uri $uri.html $uri/ /index.html;
}
location = /favicon.ico { location = /favicon.ico {
root /var/www/html; access_log off;
log_not_found off;
}
location = /robots.txt {
access_log off;
log_not_found off;
}
location / {
try_files $uri $uri.html $uri/ /index.html;
} }
# redirect server error pages to a static page # redirect server error pages to a static page