# Traefik 2 with Letsencrypt and multiple domains per host

**URL:** <https://community.traefik.io/t/traefik-2-with-letsencrypt-and-multiple-domains-per-host/6567>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [June 18, 2020, 10:27am UTC](https://community.traefik.io/t/traefik-2-with-letsencrypt-and-multiple-domains-per-host/6567 "2020-06-18T10:27:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fergalmoran](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/fergalmoran/32/2215_2.png) [@fergalmoran](https://community.traefik.io/u/fergalmoran)\
**Post date:** [June 18, 2020, 10:27am UTC](https://community.traefik.io/t/traefik-2-with-letsencrypt-and-multiple-domains-per-host/6567/1 "2020-06-18T10:27:17Z")

</div>

Hey there - I'm using docker-compose and with version 1.7 I was able to add multiple domains to my app with the following and it "just worked"!

```auto
"traefik.basic.frontend.rule=Host:apple.abc.com,banana.xyz.com"

```

However with version 2 I'm really struggling to get this to work, the closest I've got is this but it doesn't work. Has anyone got any guidance for me?

```auto
"traefik.http.routers.abc.rule=Host(`apple.abc.com`)"
"traefik.http.routers.banana.rule=Host(`banana.xyz.com`)"

```

Thanks in advance...  
Fergal.

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [June 18, 2020, 1:31pm UTC](https://community.traefik.io/t/traefik-2-with-letsencrypt-and-multiple-domains-per-host/6567/2 "2020-06-18T13:31:22Z")

</div>

```auto
"traefik.http.routers.thisroutersname.rule=Host(`apple.abc.com`,`banana.xyz.com`)"

```

---

<div class="post-metadata">

**Author:** ![fergalmoran](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/fergalmoran/32/2215_2.png) [@fergalmoran](https://community.traefik.io/u/fergalmoran)\
**Post date:** [June 18, 2020, 4:06pm UTC](https://community.traefik.io/t/traefik-2-with-letsencrypt-and-multiple-domains-per-host/6567/3 "2020-06-18T16:06:50Z")

</div>

Oh my word! I can't believe I didn't try this, thanks so much @cakiwi

---

<div class="post-metadata">

**Author:** ![ToryBerra](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/toryberra/32/7683_2.png) [@ToryBerra](https://community.traefik.io/u/ToryBerra)\
**Post date:** [October 5, 2023, 2:48pm UTC](https://community.traefik.io/t/traefik-2-with-letsencrypt-and-multiple-domains-per-host/6567/4 "2023-10-05T14:48:09Z")

</div>

Traefik 3.0.0 beta 2 when using `...Host(`X`, `Y`)`

"error while adding rule Host: unexpected number of parameters"

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [October 5, 2023, 4:22pm UTC](https://community.traefik.io/t/traefik-2-with-letsencrypt-and-multiple-domains-per-host/6567/5 "2023-10-05T16:22:50Z")

</div>

Yes. Use `Host(`x`) || Host(`y`)`. See [v3 doc](https://doc.traefik.io/traefik/v3.0/routing/routers/#rule).
