Will there be generated certificates on the fly for hostregexp matches?

I have a domainname, spelled with and without hyphen, and I want both www and non-www versions.
This gives 4 variations of the hostname.

If I were to set up a Hostregexp for (www.)domain(-)name.tld, would there be generated certificates as needed?

If not, I guess it won't work to get traefik to generate keys.

I better stick with - "traefik.http.routers.mysite.rule=(Host(www.my-site.dom) || Host(my-site.dom) || Host(www.mysite.dom) || Host(mysite.dom))"

Is it possible to split this over multiple lines, either a line-continuation character, or multiple rule lines?

Otherwise, certificates won't be made, correct?

1 Like

Hi @leifnel

Using a hostregex will not generate the certificates. You could use it in conjunction with tls.domains.

In general:
If you want to stick with a non-dns certificate resolver you can do it one of two ways.

  1. Multiple host rules. Note you can write it like this Host(`www.my-site.dom`,`my-site.dom`,`www.mysite.dom`,`mysite.dom`)
  2. Use the tls.domains option on a router. See Multiple Domains from Router's Rule Example on Lets Encrypt - Configuration Examples

Or you can do a wildcard certificate which requires the use of a DNS certificate resolver.