# TLS Redirect for multiple hosts

**URL:** <https://community.traefik.io/t/tls-redirect-for-multiple-hosts/13233>\
**Category:** Traefik v2\
**Tags:** file, docker\
**Created:** [January 28, 2022, 8:25am UTC](https://community.traefik.io/t/tls-redirect-for-multiple-hosts/13233 "2022-01-28T08:25:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamalu](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jamalu/32/4856_2.png) [@jamalu](https://community.traefik.io/u/jamalu)\
**Post date:** [January 28, 2022, 8:25am UTC](https://community.traefik.io/t/tls-redirect-for-multiple-hosts/13233/1 "2022-01-28T08:25:45Z")

</div>

Hi,  
I'm trying to setup minio ([https://min.io](https://min.io)) with docker and traefik.  
Routing is already working fine, but I have a problem.  
Minio needs 2 ports getting routed. When I make my label rules like always, tls redirect not working anymore, it's available with https but no redirect.

Here are my labels

```auto
    - 'traefik.enable=true'
    - 'traefik.http.routers.first.entrypoints=http'
    - 'traefik.http.routers.first.rule=Host(`first.bar`)'
    - 'traefik.http.routers.first.middlewares=https-redirect@file'
    - 'traefik.http.routers.first-secure.entrypoints=https'
    - 'traefik.http.routers.first-secure.rule=Host(`first.bar`)'
    - 'traefik.http.routers.first-secure.tls=true'
    - 'traefik.http.routers.first-secure.tls.certresolver=http'
    - 'traefik.http.routers.first-secure.service=first'
    - 'traefik.http.routers.first-secure.middlewares=secHeaders@file'
    - 'traefik.http.services.first.loadbalancer.server.port=9000'
    - 'traefik.http.routers.second.entrypoints=http'
    - 'traefik.http.routers.second.rule=Host(`second.bar`)'
    - 'traefik.http.routers.second.middlewares=https-redirect@file'
    - 'traefik.http.routers.second-secure.entrypoints=https'
    - 'traefik.http.routers.second-secure.rule=Host(`second.bar`)'
    - 'traefik.http.routers.second-secure.tls=true'
    - 'traefik.http.routers.second-secure.tls.certresolver=http'
    - 'traefik.http.routers.second-secure.service=second'
    - 'traefik.http.routers.second-secure.middlewares=secHeaders@file'
    - 'traefik.http.services.second.loadbalancer.server.port=9001'
    - 'traefik.docker.network=proxy'

```

If I remove on service and just 9000 or 9001 it's working like expected.

```auto
    - 'traefik.enable=true'
    - 'traefik.http.routers.first.entrypoints=http'
    - 'traefik.http.routers.first.rule=Host(`first.bar`)'
    - 'traefik.http.routers.first.middlewares=https-redirect@file'
    - 'traefik.http.routers.first-secure.entrypoints=https'
    - 'traefik.http.routers.first-secure.rule=Host(`first.bar`)'
    - 'traefik.http.routers.first-secure.tls=true'
    - 'traefik.http.routers.first-secure.tls.certresolver=http'
    - 'traefik.http.routers.first-secure.service=first'
    - 'traefik.http.routers.first-secure.middlewares=secHeaders@file'
    - 'traefik.http.services.first.loadbalancer.server.port=9000'
    - 'traefik.docker.network=proxy'

```

In the traefik dashboard is only one the http entrypoint visible.

---

<div class="post-metadata">

**Author:** ![jamalu](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jamalu/32/4856_2.png) [@jamalu](https://community.traefik.io/u/jamalu)\
**Post date:** [January 31, 2022, 7:19am UTC](https://community.traefik.io/t/tls-redirect-for-multiple-hosts/13233/2 "2022-01-31T07:19:21Z")

</div>

I found the answer here [docker - Multiple Routers and Services on the same container with traefik 2 - Stack Overflow](https://stackoverflow.com/a/59859846/1518174). I forgot to define the service for the non tls part.
