block semrush bot through robots.txt
This commit is contained in:
parent
e3b0a2145a
commit
7197f2e6a2
3 changed files with 14 additions and 1 deletions
|
@ -3,3 +3,4 @@ FROM nginx:1.24-bullseye
|
|||
COPY ./site-html /var/www/blog
|
||||
COPY ./site-repo/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY ./site-repo/counter /var/www/counter
|
||||
COPY ./site-repo/robots.txt /var/www/robots.txt
|
||||
|
|
12
nginx.conf
12
nginx.conf
|
@ -2,7 +2,9 @@ server {
|
|||
listen 80;
|
||||
server_name _;
|
||||
|
||||
return 418;
|
||||
location /robots.txt {
|
||||
alias /var/www/robots.txt;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
|
@ -21,6 +23,10 @@ server {
|
|||
add_header Cache-Control "public";
|
||||
}
|
||||
|
||||
location /robots.txt {
|
||||
alias /var/www/robots.txt;
|
||||
}
|
||||
|
||||
error_page 404 /404.html;
|
||||
}
|
||||
|
||||
|
@ -33,6 +39,10 @@ server {
|
|||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /robots.txt {
|
||||
alias /var/www/robots.txt;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
|
|
2
robots.txt
Normal file
2
robots.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
User-agent: SemrushBot
|
||||
Disallow: /
|
Reference in a new issue