From 282df2bf02f6008ecccd855aacc3902169eb023a Mon Sep 17 00:00:00 2001 From: Deimos Date: Wed, 4 Dec 2019 18:27:20 -0700 Subject: [PATCH] Block SemrushBot in nginx (it ignores robots.txt) --- salt/salt/nginx/tildes.conf.jinja2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/salt/salt/nginx/tildes.conf.jinja2 b/salt/salt/nginx/tildes.conf.jinja2 index a679a77..df7749e 100644 --- a/salt/salt/nginx/tildes.conf.jinja2 +++ b/salt/salt/nginx/tildes.conf.jinja2 @@ -13,6 +13,11 @@ map $sent_http_content_type $expires_type_map { } server { + # block bots that don't obey robots.txt + if ($http_user_agent ~* (SemrushBot)) { + return 403; + } + # remove trailing slash from addresses, the $port thing is a hack for # development in Vagrant, so the port forwarding from the host is kept set $port '';