# TCP SNI passthrough with "wildcard" routing?

**URL:** <https://community.traefik.io/t/tcp-sni-passthrough-with-wildcard-routing/2856>\
**Category:** Traefik v2\
**Tags:** tcp\
**Created:** [November 7, 2019, 2:54pm UTC](https://community.traefik.io/t/tcp-sni-passthrough-with-wildcard-routing/2856 "2019-11-07T14:54:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mumie](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mumie](https://community.traefik.io/u/mumie)\
**Post date:** [November 7, 2019, 2:54pm UTC](https://community.traefik.io/t/tcp-sni-passthrough-with-wildcard-routing/2856/1 "2019-11-07T14:54:12Z")

</div>

hello,  
iam trying to use Traefik as a global ingress gateway and want to split traffic for 2 domains.  
For Example like so:

```auto
[tcp.routers]
  [tcp.routers.example1]
    entryPoints = ["https"]
    rule = "HostSNI(`*.example1.com`)"
    service = "example1_backend_https"
    [tcp.routers.example1.tls]
        passthrough = true

  [tcp.routers.example2]
    entryPoints = ["https"]
    rule = "HostSNI(`*.example2.com`)"
    service = "example2_backend_https"
    [tcp.routers.example2.tls]
        passthrough = true

```

I Think this is not implemented yet? something Like HostSniRegex('\*.domain.tld')?

Best Regards

---

<div class="post-metadata">

**Author:** ![zespri](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/zespri/32/310_2.png) [@zespri](https://community.traefik.io/u/zespri)\
**Post date:** [November 7, 2019, 9:43pm UTC](https://community.traefik.io/t/tcp-sni-passthrough-with-wildcard-routing/2856/2 "2019-11-07T21:43:25Z")

</div>

Yeah, it does not look like there is a way to make this work currently.

---

<div class="post-metadata">

**Author:** ![ryanjaeb](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@ryanjaeb](https://community.traefik.io/u/ryanjaeb)\
**Post date:** [December 13, 2019, 11:48pm UTC](https://community.traefik.io/t/tcp-sni-passthrough-with-wildcard-routing/2856/3 "2019-12-13T23:48:29Z")

</div>

I would also like to be able to do this. Any idea if there's a feature request for it or where to make a request?

---

<div class="post-metadata">

**Author:** ![zespri](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/zespri/32/310_2.png) [@zespri](https://community.traefik.io/u/zespri)\
**Post date:** [December 18, 2019, 12:30am UTC](https://community.traefik.io/t/tcp-sni-passthrough-with-wildcard-routing/2856/4 "2019-12-18T00:30:40Z")

</div>

@ldez is that something you are considering?

---

<div class="post-metadata">

**Author:** ![mumie](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mumie](https://community.traefik.io/u/mumie)\
**Post date:** [May 30, 2020, 10:59pm UTC](https://community.traefik.io/t/tcp-sni-passthrough-with-wildcard-routing/2856/5 "2020-05-30T22:59:13Z")

</div>

Would be nice to have this feature.  
So i dont have to use haproxy for example.  
Best Regards

---

<div class="post-metadata">

**Author:** ![astuffedtiger](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/astuffedtiger/32/1636_2.png) [@astuffedtiger](https://community.traefik.io/u/astuffedtiger)\
**Post date:** [September 16, 2020, 6:14pm UTC](https://community.traefik.io/t/tcp-sni-passthrough-with-wildcard-routing/2856/6 "2020-09-16T18:14:27Z")

</div>

I would definitely love to see this as well. It's not possible to add all subdomains of my application because, well, they're a wildcard haha 😝

---

<div class="post-metadata">

**Author:** ![imnieves](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/imnieves/32/2819_2.png) [@imnieves](https://community.traefik.io/u/imnieves)\
**Post date:** [November 7, 2020, 3:35am UTC](https://community.traefik.io/t/tcp-sni-passthrough-with-wildcard-routing/2856/7 "2020-11-07T03:35:04Z")

</div>

I also agree, this would be hugely useful. I build many sites that dynamically create subdomains. So I depend on wildcard SSL certs. When it comes time to specify routing rules, I rely heavily on regex/wildcard pattern matching because I cannot manually enumerate all subdomains.

---

<div class="post-metadata">

**Author:** ![gbuades](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/gbuades/32/4661_2.png) [@gbuades](https://community.traefik.io/u/gbuades)\
**Post date:** [December 20, 2021, 8:20am UTC](https://community.traefik.io/t/tcp-sni-passthrough-with-wildcard-routing/2856/8 "2021-12-20T08:20:11Z")

</div>

I've prepared a patch to allow wildcard SNI matches.  
The patch can be obtained from our github fork: [Allow wildcards in HostSNI · Soffid/traefik@6847738 · GitHub](https://github.com/Soffid/traefik/commit/68477382a2a14f52421fc8ab510e6caf2940b91a)

It would be nice it could be merged in mainstream code.
