robots.txt

This commit is contained in:
skeris 2024-02-11 14:21:38 +03:00
parent e3dd12d821
commit 8fce0e21db
3 changed files with 18 additions and 0 deletions

@ -4,3 +4,4 @@ COPY privkey.pem /etc/nginx/
COPY fullchain.pem /etc/nginx/ COPY fullchain.pem /etc/nginx/
COPY default.conf /etc/nginx/conf.d/ COPY default.conf /etc/nginx/conf.d/
COPY index.html /usr/share/nginx/html/404/ COPY index.html /usr/share/nginx/html/404/
COPY robots.txt /usr/share/nginx/html/robots.txt

@ -280,6 +280,13 @@ server {
} }
} }
location /robots.txt {
if ($host = services,pena.digital) {
return 301 https://pena.digital/robots.txt;
}
try_files $uri $uri/ /index.html;
}
listen [::]:443 ssl ipv6only=on; listen [::]:443 ssl ipv6only=on;
listen 443 ssl; # managed by Certbot listen 443 ssl; # managed by Certbot
ssl_certificate /etc/nginx/fullchain.pem; # managed by Certbot ssl_certificate /etc/nginx/fullchain.pem; # managed by Certbot
@ -290,5 +297,13 @@ server {
listen 80 ; listen 80 ;
listen [::]:80 ; listen [::]:80 ;
server_name _; server_name _;
location /robots.txt {
if ($host = services,pena.digital) {
return 301 https://pena.digital/robots.txt;
}
try_files $uri $uri/ /index.html;
}
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
} }

2
robots.txt Normal file

@ -0,0 +1,2 @@
User-agent: *
Disallow: /