Subdomains, wildcard and Cloudflare

Hello ,

I have setup Traefik 2 (latest tag) for my domain hosted and proxied at Cloudflare and everything works just fine so far using acme.json file, dns auth etc etc for certs except for subdomains.
Currently I'm able to access https://anyhost.mydomain.tld but https://anyhost.anysubdomain.mydomain.tld won't work.

To add https:// access to subdomains I tried to add this line in Traefik 2 docker compose file in "labels:" section :

  - "traefik.frontend.rule=HostRegexp:{subdomain:[a-z0-9]*}.mydomain.tld"

Without success so far, not sure about this extra line effectiveness neither.

Help would be much welcome ! :slight_smile:

1 Like

Same here, or at least similar. Have you had any luck getting this to work yet? I'm able to get working (properly routing to an encrypted HTTP service), but not I'm using traefik v2.2.8 set up with docker-compose on a publicly-addressable server. Let's Encrypt too. I see that my acme.json file has entries like,, etc but none for any next-level subdomains like

Maybe I need to do something with DNS? I have an A record from * only. Does that automatically handle *.* too, or do I need more?

...aha, looks like the issue for me is encryption, not routing. I confirmed this when I noticed curl --insecure properly routes to the right service.

Did you manage to resolve this issue? I am hitting the same problem