Skip to content
Fabrizio Salmi edited this page Sep 6, 2026 · 2 revisions

Caddy MIB Wiki

Caddy middleware that tracks client IPs producing repeated HTTP errors, typically 404 and 401 probing, and temporarily bans them.

There is no separate documentation site for this project: the README carries everything, and it has grown large enough that finding one directive means scrolling past everything else. This wiki splits it into pages you can link to, and adds the material that currently lives only inside closed issues.

Pages

  • Installation: building Caddy with the module, and what to check afterwards
  • Configuration reference: every directive, whether it is required, its default, and how per-path blocks override the global settings
  • How banning works: the counting model, the sliding window, exponential ban growth, and the difference between whitelisting and CIDR bans
  • Running under caddy-docker-proxy: building the image and wiring the middleware through container labels
  • Testing and troubleshooting: the bundled test script, the log lines to look for, and what to check when nothing gets banned

Requirements

Go 1.20 or later to build, Caddy v2.9.0 or later to run. The module is compiled into Caddy with xcaddy, so there is no plugin to load at runtime.

The shortest possible configuration

caddy_mib {
    error_codes 404
    max_error_count 10
    ban_duration 5s
}

Those three directives are required. Everything else has a default and can be left out until you need it.

Clone this wiki locally