aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Fandrich <danf@mageia.org>2025-09-07 16:10:07 -0700
committerDan Fandrich <danf@mageia.org>2025-09-07 16:10:07 -0700
commit6802d174773aa5b2aa929bf6ec049d07d9761b10 (patch)
tree36beffff54895d364466cad4c2e7d9860fdd867a
parentde3955b4904c4121902f397dd628cecdf210cddd (diff)
downloadpuppet-6802d174.tar
puppet-6802d174.tar.gz
puppet-6802d174.tar.bz2
puppet-6802d174.tar.xz
puppet-6802d174.zip
Treat anything other than a plain path as "expensive"
Try to reduce svnweb load by making anything other than a plain path require an anti-robot cookie.
-rw-r--r--modules/apache/templates/vhost_fcgid.conf8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/apache/templates/vhost_fcgid.conf b/modules/apache/templates/vhost_fcgid.conf
index f137c866..0643cac9 100644
--- a/modules/apache/templates/vhost_fcgid.conf
+++ b/modules/apache/templates/vhost_fcgid.conf
@@ -19,7 +19,9 @@ RewriteRule . - [R=403,L]
# directory or downloading a specific version of a file.
# Note: eliminating view=log and annotate= doesn't make much difference to the
# CPU load when robots are hitting the server in real world operation.
-RewriteCond %{QUERY_STRING} pathrev=|r1=
+#RewriteCond %{QUERY_STRING} pathrev=|r1=
+# Treat anything other than a plain path as "expensive"
+RewriteCond %{QUERY_STRING} .
RewriteCond %{HTTP_USER_AGENT} "Googlebot|GoogleOther|bingbot|Yahoo! Slurp|ClaudeBot|Amazonbot|YandexBot|SemrushBot|Barkrowler|DataForSeoBot|PetalBot|facebookexternalhit|GPTBot|ImagesiftBot|spider|Spider|iPod|Trident|Presto"
RewriteRule . - [R=403,L]
@@ -28,7 +30,9 @@ RewriteRule . - [R=403,L]
# back. This will block requests from user agents that do not support
# JavaScript, which includes many robots.
RewriteMap urlescape prg:/usr/local/bin/urlescape
-RewriteCond %{QUERY_STRING} pathrev=|r1=
+#RewriteCond %{QUERY_STRING} pathrev=|r1=
+# Treat anything other than a plain path as "expensive"
+RewriteCond %{QUERY_STRING} .
RewriteCond %{REQUEST_URI} !/_check
RewriteCond %{HTTP_COOKIE} !session=([^;]+) [novary]
RewriteRule . %{REQUEST_SCHEME}://%{SERVER_NAME}:%{SERVER_PORT}/_check?to=%{REQUEST_URI}?${urlescape:%{QUERY_STRING}} [R=302,L]