Discourage bots indexing HG: Python is slow and cause OOM kills...
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 28 May 2025 00:15:07 +0300
changeset 41 af1919427dfc
parent 38 5c3fb23b9208
child 42 a9e95c9c0f4d
Discourage bots indexing HG: Python is slow and cause OOM kills...
deb/apache-register-hg.bash
--- a/deb/apache-register-hg.bash	Thu May 02 16:02:45 2024 +0300
+++ b/deb/apache-register-hg.bash	Wed May 28 00:15:07 2025 +0300
@@ -53,6 +53,11 @@
         Require all granted
     </Directory>
 
+    # Discourage bots indexing HG: Python is slow and cause OOM kills...
+    <IfModule mod_headers.c>
+      Header add "X-Robots-Tag" "noindex, nofollow"
+    </IfModule>
+
     ScriptAliasMatch  ^/(.*)  /srv/hg/hgweb.cgi/\$1
 
     <Directory "/srv/hg/">
@@ -68,6 +73,10 @@
     DocumentRoot /srv/hg
     ServerName hg.defun.work
 
+    <IfModule mod_headers.c>
+      Header add "X-Robots-Tag" "noindex, nofollow"
+    </IfModule>
+
     ScriptAliasMatch  ^/(.*)  /srv/hg/hgweb.cgi/\$1
 
     <Directory "/srv/hg/">
@@ -81,4 +90,5 @@
 EOF
 
 a2ensite hg
+a2enmod headers
 service apache2 reload