Docker Swarm + traefik

Hi,
Could someone help me?

I try to find a solution that helps me configure some default service in a docker swarm cluster.
I use the traefik tool for redirecting between docker swarm services by domain names.
But I want to have some default service. If a domain name doesn’t exist, the network traffic will be redirected to this default docker service (as the UCP tool has “default host service”)
For example:
If we have URL:web1.example.com, the user will be redirected to the web1 service.
If we have URL:web2.example.com, the user will be redirected to the web2 service.
BUT
If we have not URL: test.example.com, the user should be redirected to some default service in a docker swarm.
I learned the Traefik documentation and found that I can configure domain wildcard in the Traefik.
But we should use the DNS-01 challenge with some cloud provider (https://docs.traefik.io/https/acme/#dnschallenge).
It looks like this:

## Dynamic configuration
[http.routers]
  [http.routers.routerbar]
    rule = "Host(`snitest.com`)
      [[http.routers.routerbar.tls.domains]]
        main = "snitest.com"
        sans = ["*.snitest.com"]

Did someone configure it before? Or maybe someone knows tools for creating default service in the docker swarm cluster?

1 Like

Hi. I’m the head of community for Traefik. We’re happy to help over at the Community Forum! https://community.containo.us/