Problem,
I have multiple services that are deployed on Docker containers. Each set of our clients should be routed to a specific service. Example:
This should done using subdomain: client1= client1.example.com client2 = client2.example.com
Question:
I would like this config to be dynamic meaning that Traefik needs to get these routing rules dynamically from another service:
Details:
This feature is useful when I create a saas application.
Thank you very much.
One easy way to achieve this is to use regex for the defined routers for each of the services and update the regex once you onboarded a new client
For instance, add this label to the service 1
- traefik.http.routers.app-backend.rule=HostRegexp(`{subdomain:(clinet1)}.example.com`)
and when you add another client that should be served by service 1, just update the label to be
- traefik.http.routers.app-backend.rule=HostRegexp(`{subdomain:(clinet1|clientX)}.example.com`)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.