Skip to content

Caddy Warden ​

Native security middleware for Caddy v2 to protect sensitive files, block reconnaissance bots, and stop path evasion tricks.

Caddy Warden (github.com/routewarden/caddy-warden) is an official Caddy v2 HTTP module. It plugs directly into your Caddyfile or Caddy's dynamic JSON API, blocking scanner probes before they touch your upstream web apps.


What Does Caddy Warden Do? ​

🛡️ Instant Sensitive File Shield

Automatically blocks scans targeting .env, .git, AWS credentials, database dumps, and server status endpoints with zero config.

🔍 Automatic Anti-Evasion

Cleans up sneaky URLs before evaluating rules—handling double URL encoding, semicolon parameters, backslashes, and null bytes.

📝 Simple Caddyfile Directive

Configure everything in 3 lines right inside your existing Caddyfile or dynamically via Caddy's REST API.

💣 Deception & Custom Responses

Reply to attackers with custom JSON, 404 deceptions, silent TCP drops, Turnstile captcha challenges, or bot-crashing gzip bombs.


30-Second Quick Start ​

Add Caddy Warden directives to your Caddyfile or JSON API:

{    order routewarden before reverse_proxy}example.com {    routewarden {        enable_default_patterns true    }    reverse_proxy localhost:8080}

Installation & Build ​

Build a custom Caddy binary with caddy-warden or run via Docker:

# docker-compose.ymlservices:  caddy:    build:      context: .      dockerfile_inline: |        FROM caddy:2-builder AS builder        RUN xcaddy build --with github.com/routewarden/caddy-warden@v1.4.1        FROM caddy:2-alpine        COPY --from=builder /usr/bin/caddy /usr/bin/caddy    ports:      - "80:80"      - "443:443"    volumes:      - ./Caddyfile:/etc/caddy/Caddyfile:ro      - caddy_data:/data      - caddy_config:/configvolumes:  caddy_data:  caddy_config:

Explore the Documentation ​

GuideDescription
🚀 Getting StartedBuild Caddy with xcaddy or run with Docker in 2 minutes.
⚙️ Caddyfile ReferenceDirective ordering, syntax schema, and configuration options.
📡 JSON API ReferenceNative Caddy REST API schema and zero-downtime reconfiguration.
💡 Caddy Recipes & ExamplesReal-world Caddyfile recipes (Honeypot bombs, Turnstile, VPN allowlists).
📜 Changelog & ReleasesComplete release history, directive updates, and migration notes.

Released under the MIT License.