Skip to content

Commit 22e9dc8

Browse files
committed
Make Apache block some self-identified bots.
While the proxy servers can block by user-agent for plain traffic, they cannot for TLS connections.
1 parent e5cdd7a commit 22e9dc8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/fedora/config/etc/httpd/conf/httpd.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ UserDir disabled
110110
<Directory />
111111
AllowOverride None
112112
Options FollowSymLinks IncludesNoExec
113+
114+
# Block some (self-identifying) bots, by giving them a 403.
115+
# The proxy servers should catch these (/etc/haproxy/blacklist-agent.txt),
116+
# but it can only look at HTTP traffic. This was added primarily for HTTPS
117+
# traffic.
118+
Require expr %{HTTP_USER_AGENT} !~ /Bytespider|Bytedance|ClaudeBot/
119+
113120
# The new syntax wasn't added until 2.4,
114121
# so there's simply no way any deployed sites
115122
# are already using the new syntax.

0 commit comments

Comments
 (0)