caddy-cloudflare-wildcard-proxylisted
Install: claude install-skill jackson2w/claude-code-skills
# Caddy + Cloudflare DNS-01 wildcard proxy for internal domains
Pattern for fronting several internal/homelab services with friendly hostnames
(`service.example.dev`) under one real, trusted wildcard certificate, without any public DNS
record — Cloudflare is used purely as the ACME DNS-01 challenge provider.
## Custom Caddy build for DNS plugins
Stock Caddy packages (apt, official binary releases) do **not** include DNS provider modules —
DNS-01 wildcard certs need `caddy-dns/cloudflare` (or the equivalent for another provider), which
isn't in the default build. Rather than requiring a Go toolchain + `xcaddy` on the target host,
fetch a prebuilt custom binary from Caddy's official build server:
```
https://caddyserver.com/api/download?os=linux&arch=amd64&p=github.com%2Fcaddy-dns%2Fcloudflare
```
Verified live: returns HTTP 200, `content-disposition: attachment; filename="caddy_linux_amd64_custom"`.
Swap `p=` for a different DNS provider module path, or chain multiple `&p=` params for more than
one plugin. Use `ansible.builtin.get_url` (or plain `curl`) straight to `/usr/local/bin/caddy`,
mode `0755` — no build step needed on the target.
## One wildcard cert covering many hostnames
Put every internal hostname in a **single site block** keyed on the apex + wildcard, and route
by `Host` header inside it with `@matcher`/`handle` pairs — not one site block per hostname (that
issues a separate cert per name):
```caddyfile
{
email you@example.com
}
example.dev, *.exampl