42 lines
848 B
Caddyfile
42 lines
848 B
Caddyfile
# Fixture using every plugin directive in the shapes the real Caddyfile uses.
|
|
{
|
|
auto_https off
|
|
order crowdsec first
|
|
order appsec after crowdsec
|
|
crowdsec {
|
|
api_url http://crowdsec:8080
|
|
api_key {$CROWDSEC_API_KEY}
|
|
ticker_interval 15s
|
|
appsec_url http://crowdsec:7422
|
|
appsec_max_body_bytes 1048576
|
|
appsec_fail_open
|
|
}
|
|
}
|
|
|
|
(protect) {
|
|
crowdsec
|
|
appsec
|
|
}
|
|
|
|
(ratelimit_login) {
|
|
rate_limit {
|
|
zone {args[0]} {
|
|
match {
|
|
method POST
|
|
path {args[1:]}
|
|
not remote_ip private_ranges 100.64.0.0/10
|
|
}
|
|
key {client_ip}
|
|
events 10
|
|
window 1m
|
|
}
|
|
log_key
|
|
}
|
|
}
|
|
|
|
:8080 {
|
|
import protect
|
|
import ratelimit_login test_login /login /api/token/
|
|
respond "ok"
|
|
}
|