traefik two hosts in the same config

I’m trying to run Nexus in swarm with traefik, nexus has a admin interface that runs on port 8081 and also has a nexus docker registry repository running on port 9615.

My goal is access registry through registry.docker.domain and nexus by nexus.domain but I am not able to do this.

traefik config on compose

  - 8081
  - 9615
    - "traefik.enable=true"
    # Config Nexus
    - "'nexus.domain')"
    - ""
    - ""
    - ""

    # Config Registry
    - "traefik.http.router.registry.rule=Host('registry.docker')"
    - ""
    - "traefik.http.routers.registry.entrypoints=web-secure"
    - "traefik.http.routers.registry.tls=true"
    - "traefik.http.routers.registry.service=registry"

If I set up only registry labels I can access the registry by https.://registry.domanin and nexus by registry.domain:PORT

If I set up only nexus labels I can access nexus by http:.//Nexus.domain

But the config above, with labels for both at the same time, didn’t work, nexus and registry return 404.

Obs: I’m using traefik 2.2, the documentation and the use are very different from 1.6

Go to Source
Author: Joao Vitorino