1. Caddy version (caddy version
):
2.2.1
2. How I run Caddy:
bin/caddy run -config assets/conf/Caddyfile
a. System environment:
macOS Catalina
b. Command:
bin/caddy run -config assets/conf/Caddyfile
c. Service/unit/compose file:
paste full file contents here
d. My complete Caddyfile or JSON config:
@blocklist {
import blockeduseragents.conf
import blockedreferers.conf
import blockedproxytargets.conf
}
rewrite @blocklist /bad-actor
respond /bad-actor 403
blockeduseragents.conf
# List all bad User-Agents:
header User-Agent STRING1*
header User-Agent STRING2*
blockedreferers.conf
# List all bad Referrers:
header Referer *STRING3
header Referer *STRING4
3. The problem I’m having:
I want to build lists of known bad actor attributes and if a request matches ANY of the many configured tests I’ll rewrite and 403 as above.
I can build and format the conf file content from lists available externally.
But as a newbie I’m confused. As I understand it, all these tests will be AND’d and not OR’d… unless each test is defined in its own match set.
Am I right? Each conf file could contain a few hundred tests…
Is the V2 matcher design intended for this sort of use or should I go ahead and write a custom matcher to work on bulk configuration like this?
Maybe as a newbie I just missed the right feature to use