diff --git a/default.conf b/default.conf index 0145a56..f6c2000 100644 --- a/default.conf +++ b/default.conf @@ -1,5 +1,8 @@ server { root /usr/share/nginx/html; + location /robots.txt { + try_files $uri $uri/ /index.html; + } index index.html index.htm index.nginx-debian.html; server_name hbpn.link; # managed by Certbot @@ -40,6 +43,9 @@ server { } server { root /usr/share/nginx/html; + location /robots.txt { + try_files $uri $uri/ /index.html; + } index index.html index.htm index.nginx-debian.html; server_name quiz.pena.digital; # managed by Certbot @@ -180,6 +186,9 @@ server { index index.html index.htm index.nginx-debian.html; server_name hub.pena.digital; # managed by Certbot client_max_body_size 70M; + location /robots.txt { + try_files $uri $uri/ /index.html; + } location /404 { try_files $uri $uri/ /index.html; @@ -288,6 +297,9 @@ server { index index.html index.htm index.nginx-debian.html; server_name pena.digital; # managed by Certbot client_max_body_size 70M; + location /robots.txt { + try_files $uri $uri/ /index.html; + } location /404 { try_files $uri $uri/ /index.html; @@ -318,6 +330,10 @@ server { root /var/www/certbot; } + location /robots.txt { + try_files $uri $uri/ /index.html; + } + location / { return 301 https://$host$request_uri; }