Wildcard Domains aren't being made or I am an idiot

I’m not sure I agree with how you’ve set this up. I’m using a wildcard domain in Caddy with Cloudflare as my DNS hosting provider and it works fine. However, the approach I’m using essentially the reverse of what you’re attempting.

For a start, I have the wildcard domain set up in the Caddyfile e.g.

*.domain.com {
  ...
}

A good reference here is the Subdomains (wildcard certificate) section in the forum wiki article Serving tens of thousands of domains over HTTPS with Caddy

Secondly, unless you’re a Cloudflare Enterprise customer, you won’t get full proxy support for wildcard records. To get full protection, you need to explicitly define CNAME records for each subdomain (wiki and test in your Caddyfile). See this Cloudflare FAQ reference Does Cloudflare support wildcard DNS entries?.

2 Likes