From a0397d7abbae94dfa101b15320c1ebcab0db54bc Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Mon, 8 Jul 2024 12:22:23 -0400 Subject: [PATCH] Add blocks to nagios.conf httpd I forgot I am the expert on nagios configs so added it to the template file. Signed-off-by: Stephen Smoogen --- roles/nagios_server/templates/httpd/nagios.conf.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/nagios_server/templates/httpd/nagios.conf.j2 b/roles/nagios_server/templates/httpd/nagios.conf.j2 index a69922c3e9..ec9a9a39f0 100644 --- a/roles/nagios_server/templates/httpd/nagios.conf.j2 +++ b/roles/nagios_server/templates/httpd/nagios.conf.j2 @@ -51,6 +51,11 @@ Alias /robots.txt /var/www/robots.txt RewriteEngine on RewriteRule ^/$ /nagios/ [R] +# Spiders-gone-wild +# These spiders may not follow robots.txt and will +# hit admin sections which consume large amounts of CPU +RewriteCond %{HTTP_USER_AGENT} ^.*(Bytespider|ClaudeBot|Amazonbot|YandexBot|ChatGLM-Spider|GPTBot|Barkrowler|YisouSpider|MJ12bot).*$ [NC] +RewriteRule .* - [F,L] Alias /nagios /usr/share/nagios/html/