mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 07:40:39 -04:00
Ban ChatGPT user agents
This commit is contained in:
parent
ceccd1431e
commit
8a3a05a264
2 changed files with 10 additions and 2 deletions
|
@ -160,7 +160,11 @@ Define conf_rewrite_root ${web_root}/config/apache/rewrites
|
|||
# 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]
|
||||
RewriteRule ^ - [L,F]
|
||||
|
||||
# ChatGPT has DDOS'd sites before. Short-circuit any ChatGPT requests to HTTP 429.
|
||||
RewriteCond %{HTTP_USER_AGENT} ChatGPT-User
|
||||
RewriteRule ^ - [L,R=429]
|
||||
|
||||
# In RewriteCond, RewriteRule gets evaluated BEFORE RewriteCond, so $1 refers to the first
|
||||
# match in RewriteRule
|
||||
|
|
|
@ -142,7 +142,11 @@ Define conf_rewrite_root ${web_root}/config/apache/rewrites
|
|||
# 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]
|
||||
RewriteRule ^ - [L,F]
|
||||
|
||||
# ChatGPT has DDOS'd sites before. Short-circuit any ChatGPT requests to HTTP 429.
|
||||
RewriteCond %{HTTP_USER_AGENT} ChatGPT-User
|
||||
RewriteRule ^ - [L,R=429]
|
||||
|
||||
# In RewriteCond, RewriteRule gets evaluated BEFORE RewriteCond, so $1 refers to the first
|
||||
# match in RewriteRule
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue