I have one node typescript project and I have already set my project with Traefik through docker compose, and I already can access the APIs through the domain that I set in Traefik router host.
now, I want to white label custom domains, can anyone guide me with this, how can I make it possible.
You can add your custom domains to your Traefik dynamic config (file or labels):
.rule=Host(`example.com`) || Host(`foobar.com`)
If you use different TLDs, then LE will create separate TLS/SSL certs. Note that LE has a limit of 50 certs/week.
If you use sub-domains, then you can create a TLS wildcard cert with Traefik LetsEncrypt dnsChallenge
.
1 Like
yes, I can add Hosts like this,
but what if I need to add new Hosts in the configuration file,
is there any way to make it dynamic, means I can use there one variable like ${HOSTS} and then store those hosts some where else. and this configurations should be updated in real time?
Yes, you can use dynamic config file or use providers.docker
and add it to the labels (instead of env) to each service.
And there is a defaultRule
, which can be used for something like ${host}.example.com
. Search the docs or forum for an example.
1 Like
yes, exactly currently I am setting up the dynamic config files.
but in my case I will have multiple domains like there can be 'test.example.com', 'abc.anything.com', 'asdf.ghjk.app'. and also if I got some another custom host then I will add them in my hosts list.
for that I want to make it dynamic.
and if you can give some examples which can relate to my requirement that would be very helpful.