# Migrate frontend rule for bitwarden\_rs websocket properly

**URL:** <https://community.traefik.io/t/migrate-frontend-rule-for-bitwarden-rs-websocket-properly/2456>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [October 18, 2019, 2:40pm UTC](https://community.traefik.io/t/migrate-frontend-rule-for-bitwarden-rs-websocket-properly/2456 "2019-10-18T14:40:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidh2k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/davidh2k/32/925_2.png) [@davidh2k](https://community.traefik.io/u/davidh2k)\
**Post date:** [October 18, 2019, 2:40pm UTC](https://community.traefik.io/t/migrate-frontend-rule-for-bitwarden-rs-websocket-properly/2456/1 "2019-10-18T14:40:48Z")

</div>

In Traefik 1.7 I have the following labels for my bitwarden\_rs container and I'd like to know how to properly translate the second frontend rule of it for traefik 2.0. I think I need a second router for that, but i'd like to get som verfification beforehand:

```auto
    labels:
      - traefik.web.frontend.rule=Host:service.domain.tld
      - traefik.web.port=80
      - traefik.hub.frontend.rule=Host:service.domain.tld;Path:/notifications/hub
      - traefik.hub.port=3012

```

```auto
      - traefik.http.routers.traefikweb.entrypoints=websecure
      - traefik.http.routers.traefikweb.rule=Host(`service.domain.tld`)
      - traefik.http.routers.traefikweb.tls=true
      - traefik.http.routers.traefikweb.tls.certresolver=le

      - traefik.http.routers.traefikhub.entrypoints=websecure
      - traefik.http.routers.traefikhub.rule=(Host(`service.domain.tld`) && Path(`/notifications/hub`))
      - traefik.http.routers.traefikhub.tls=true
      - traefik.http.routers.traefikhub.tls.certresolver=le

```

Am I correct with my asumption?

Greetings  
David

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [October 18, 2019, 2:55pm UTC](https://community.traefik.io/t/migrate-frontend-rule-for-bitwarden-rs-websocket-properly/2456/2 "2019-10-18T14:55:48Z")

</div>

Hello,

```auto
      - traefik.http.routers.traefikweb.entrypoints=websecure
      - traefik.http.routers.traefikweb.rule=Host(`service.domain.tld`)
      - traefik.http.routers.traefikweb.tls=true
      - traefik.http.routers.traefikweb.tls.certresolver=le
      - traefik.http.routers.traefikweb.service=traefikweb

      - traefik.http.services.traefikweb.loadbalancer.server.port=80

      - traefik.http.routers.traefikhub.entrypoints=websecure
      - traefik.http.routers.traefikhub.rule=(Host(`service.domain.tld`) && Path(`/notifications/hub`))
      - traefik.http.routers.traefikhub.tls=true
      - traefik.http.routers.traefikhub.tls.certresolver=le
      - traefik.http.routers.traefikhub.service=traefikhub

      - traefik.http.services.traefikhub.loadbalancer.server.port=3012

```

---

<div class="post-metadata">

**Author:** ![davidh2k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/davidh2k/32/925_2.png) [@davidh2k](https://community.traefik.io/u/davidh2k)\
**Post date:** [October 18, 2019, 2:58pm UTC](https://community.traefik.io/t/migrate-frontend-rule-for-bitwarden-rs-websocket-properly/2456/3 "2019-10-18T14:58:25Z")

</div>

You're specifying the service (and port) too. Is there a reason for that, just like beeing explicit to avoid issues? For my other tests it seemed that I could skip both the service and port.

Greetings  
David

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [October 18, 2019, 3:54pm UTC](https://community.traefik.io/t/migrate-frontend-rule-for-bitwarden-rs-websocket-properly/2456/4 "2019-10-18T15:54:35Z")

</div>

Basically, routers/services are like segment labels in v1.

When you define one or several routers with labels, Traefik create (and set on routers) automatically a service.

So if you want to use 2 different ports you have to explicitly create (and set on routers) the services.

---

<div class="post-metadata">

**Author:** ![davidh2k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/davidh2k/32/925_2.png) [@davidh2k](https://community.traefik.io/u/davidh2k)\
**Post date:** [October 18, 2019, 4:15pm UTC](https://community.traefik.io/t/migrate-frontend-rule-for-bitwarden-rs-websocket-properly/2456/5 "2019-10-18T16:15:50Z")

</div>

Thank you. That worked perfectly. 🙂

---

<div class="post-metadata">

**Author:** ![Eoras](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/eoras/32/974_2.png) [@Eoras](https://community.traefik.io/u/Eoras)\
**Post date:** [October 22, 2019, 7:49am UTC](https://community.traefik.io/t/migrate-frontend-rule-for-bitwarden-rs-websocket-properly/2456/6 "2019-10-22T07:49:36Z")

</div>

> [@ldez](#):
>
> traefik.http.routers.traefikweb.service=traefikweb

This work. THANK YOU 🙃  
I was almost there, but I had a 404 error because I did not name my different services.
