Production-ready Caddy with Coraza WAF, rate limiting, Brotli, Souin cache and 6 DNS providers
965
Maintained by morsalin1342 · GitHub
A custom Caddy build with the OWASP Coraza WAF, rate limiting, AI-crawler blocking, Brotli compression, HTTP caching, and 6 DNS challenge providers for automatic HTTPS.
| Feature | Official image | This image |
|---|---|---|
| Brotli compression | ❌ | ✅ cbrotli |
| HTTP caching | ❌ | ✅ Souin — Redis, Otter, SimpleFS |
| Web application firewall | ❌ | ✅ OWASP Coraza, Core Rule Set compiled in |
| Rate limiting | ❌ | ✅ Sliding-window, per IP / header / host |
| IP range blocking | ❌ | ✅ Defender — AI crawlers, cloud ranges |
| DNS challenge | Needs a custom build | ✅ 6 providers built in |
docker run -d --name caddy \
-p 80:80 -p 443:443 -p 443:443/udp \
-v $(pwd)/Caddyfile:/etc/caddy/Caddyfile:ro \
-v caddy_data:/data \
morsalin1342/caddy:latest
{
order coraza_waf first
}
example.com {
encode zstd gzip
cache
coraza_waf {
load_owasp_crs
directives `
Include @coraza.conf-recommended
Include @crs-setup.conf.example
Include @owasp_crs/*.conf
SecRuleEngine DetectionOnly
`
}
reverse_proxy localhost:8080
}
load_owasp_crs is required for the @ include paths to resolve. Start in
DetectionOnly, tune out false positives, then switch to On.
| Category | Plugins |
|---|---|
| Security | Coraza WAF (SecLang/ModSecurity compatible, OWASP CRS compiled in) |
| Rate limiting | Sliding-window, multi-zone, keyed on any request placeholder |
| Bot / IP blocking | Defender — embedded AI-crawler and cloud-provider IP ranges |
| Compression | cbrotli (Brotli) |
| Caching | Souin with Redis, Otter, and SimpleFS backends |
| DNS/ACME | Cloudflare, Route53, DigitalOcean, Vultr, Azure, Google Cloud DNS |
latest, 2.11.4 — version-tagged for production stability.
Q: How do I turn the WAF on?
A: Add order coraza_waf first to the global options, then a coraza_waf block with load_owasp_crs. Without load_owasp_crs the @ include paths do not resolve and Caddy fails at startup. Start at SecRuleEngine DetectionOnly.
Q: How do I get a wildcard certificate?
A: All six DNS providers are pre-compiled. Set your provider's credentials and use the tls directive with dns <provider>.
Q: Can I use this with PHP? A: Use frankenphp for Caddy and PHP in one container, or pair this with php over FastCGI.
| Image / Tool | Description |
|---|---|
| morsalin1342/frankenphp | Caddy + PHP app server in one container |
| morsalin1342/php | Traditional PHP-FPM & CLI images |
| morsalin1342/nginx | nginx with ModSecurity 3, Brotli, zstd & GeoIP2 |
| easydigital/caddy | Enterprise org mirror |
| caddy-souin-cache-manager | Manage this image's Souin cache from WP Admin |
⭐ If this image helps you, consider giving it a star on GitHub!
Content type
Image
Digest
sha256:8ebfd08cf…
Size
45.6 MB
Last updated
27 days ago
docker pull morsalin1342/caddy