block semrush bot through robots.txt

This commit is contained in:
Pim Kunis 2023-08-23 19:03:22 +02:00
parent e3b0a2145a
commit 7197f2e6a2
3 changed files with 14 additions and 1 deletions

View file

@ -3,3 +3,4 @@ FROM nginx:1.24-bullseye
COPY ./site-html /var/www/blog COPY ./site-html /var/www/blog
COPY ./site-repo/nginx.conf /etc/nginx/conf.d/default.conf COPY ./site-repo/nginx.conf /etc/nginx/conf.d/default.conf
COPY ./site-repo/counter /var/www/counter COPY ./site-repo/counter /var/www/counter
COPY ./site-repo/robots.txt /var/www/robots.txt

View file

@ -2,7 +2,9 @@ server {
listen 80; listen 80;
server_name _; server_name _;
return 418; location /robots.txt {
alias /var/www/robots.txt;
}
} }
server { server {
@ -21,6 +23,10 @@ server {
add_header Cache-Control "public"; add_header Cache-Control "public";
} }
location /robots.txt {
alias /var/www/robots.txt;
}
error_page 404 /404.html; error_page 404 /404.html;
} }
@ -33,6 +39,10 @@ server {
location / { location / {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
location /robots.txt {
alias /var/www/robots.txt;
}
} }
server { server {

2
robots.txt Normal file
View file

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