Refactor duplicate config and add robots.txt location
This commit is contained in:
parent
447cbefc5f
commit
ef5dc8116a
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user