Block some leechers in Apache config

This commit is contained in:
Alex Cabal 2025-01-25 13:46:39 -06:00
parent 2258c4f742
commit c1e8e83cfb
2 changed files with 12 additions and 0 deletions

View file

@ -156,6 +156,12 @@ Define conf_rewrite_root ${web_root}/config/apache/rewrites
ProxySet connectiontimeout=5 timeout=240
</Proxy>
# Disable access to people attempting to clone the website and leech our resources by proxying via CloudFlare or some other service.
# Such services will have the custom `X-Forwarded-For` HTTP header set.
RewriteCond %{HTTP:X-Forwarded-For} . [OR]
RewriteCond %{HTTP:CF-Connecting-IP} .
RewriteRule ^.*$ - [F,L]
# In RewriteCond, RewriteRule gets evaluated BEFORE RewriteCond, so $1 refers to the first
# match in RewriteRule
# Rewrite POST /some/url -> POST /some/url/post.php

View file

@ -138,6 +138,12 @@ Define conf_rewrite_root ${web_root}/config/apache/rewrites
ProxySet connectiontimeout=5 timeout=240
</Proxy>
# Disable access to people attempting to clone the website and leech our resources by proxying via CloudFlare or some other service.
# Such services will have the custom `X-Forwarded-For` HTTP header set.
RewriteCond %{HTTP:X-Forwarded-For} . [OR]
RewriteCond %{HTTP:CF-Connecting-IP} .
RewriteRule ^.*$ - [F,L]
# In RewriteCond, RewriteRule gets evaluated BEFORE RewriteCond, so $1 refers to the first
# match in RewriteRule
# Rewrite POST /some/url -> POST /some/url/post.php