1. Output of caddy version
:
v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=
Downloaded from Download Caddy
Using Linux amd64
Selected mhold/caddy-ratelimit plugin
2. How I run Caddy:
$ ./caddy run
a. System environment:
Ubuntu 22.04
b. Command:
./caddy run
d. My complete Caddy config:
{
order rate_limit before basicauth
}
rate_limit {
distributed
zone static_example {
key static
events 100
window 1m
}
zone dynamic_example {
key {remote_host}
events 2
window 5s
}
}
respond "I'm behind the rate limiter!"
3. The problem I’m having:
Attempting to run the sample code here: GitHub - mholt/caddy-ratelimit: HTTP rate limiting module for Caddy 2
4. Error messages and/or full log output:
$ ./caddy run
2022/11/06 16:28:35.717 INFO using adjacent Caddyfile
Error: adapting config using caddyfile: Caddyfile:6: unrecognized directive: distributed
5. What I already tried:
Simplified the config, still no good.
{
order rate_limit before basicauth
}
rate_limit {
zone test {
key {remote_host}
events 2
window 5s
}
}
respond "I'm behind the rate limiter!"
$ ./caddy run
2022/11/06 16:28:35.717 INFO using adjacent Caddyfile
Error: adapting config using caddyfile: Caddyfile:6: unrecognized directive: zone