Redirect 80 and 443 on the same backend,for multiple backend, but not for all backend

Hello,

Because I'm new on the forum, I can't use more than 4 link, so I replace dot by ':' for some links, sorry for that :-\

I'm looking for a way to redirect 80 and 443 port on the same backend host, for multiple backend, but not for all backend.
Let's me try to explain:

Suppose I am working on the domain mysubdomain.anotherdomain.com. I am not a master of the anotherdomain.com domain and I cannot generate a wildcard certificate with let's encrypt for mysubdomain.anotherdomain.com . However, I can use less than 100 san thanks to let's encrypt, but it is not enough.

My traefik server is located at mysubdomain.anotherdomain.com and my multiple backend are located at undermysubdomain:mysubdomain:anotherdomain.com.

On the one hand, I'm going to have a lot of web clients below mysubdomain:anotherdomain:com (ex: web-no-san-[1-1000]:mysubdomain:anotherdomain.com) and for which I don't want to manage myself ssl certificates (but the administrators of these machines who want to do it must be able to do it).

On the other hand, I am going to have a few web clients for which I will be able to use let's encrypt with the san functionality and for which I systematically wish an HTTP redirect to https (ex: web-san-https-only [1-10]:mysubdomain:anotherdomain.com)

For next, consider that I just have web-no-san and web-san-https-only hosts.

I cannot use the lines below in comment:

[Entrypoints]
        [EntryPoints.http]
        address = ": 80"
# [entryPoints.http.redirect]
# entryPoint = "https"
        [EntryPoints.https]
        address = ": 443"

because I don't want this feature for all backend.

I can't seem to use a configuration like this:

[Backend]
  [Backends.backend1.servers.server1]
     url = "http://10.20.30.40:80"
  [Backends.backend2.servers.server1]
     url = "http://10.20.30.40:443"


[Frontends]
  [Frontends.frontend1]
    entryPoints = ["http"]
    backend = "backend1"
    passHostHeader = true
                [Frontends.frontend1.routes]
                [Frontends.frontend1.routes.route0]
                        rule = "Host: web-no-san:mysubdomain:anotherdomain:com"
[Frontends.frontend2]
    entryPoints = ["https"]
    backend = "backend2"
    passHostHeader = true
                [Frontends.frontend2.routes]
                [Frontends.frontend2.routes.route0]
                        rule = "Host: web-no-san:mysubdomain:anotherdomain:com"

I tried to add the respective port numbers on the last rule, but without success:

rule = "Host: web-no-san:mysubdomain:anotherdomain:com: 80"
rule = "Host: web-no-san:mysubdomain:anotherdomain:com: 443"

And I don't see how to declare my servers of type web-san-https-only1

Do you think my use case can be satisfied by traefik? And if so, do you have any idea how I should be successful?

I hope my explanation has been clear, thank you in advance for your possible help.

Best regards,

jmc

Hello,

Apparently we can do this kind of thing using version 2 of traefik with the functionality of TCP router and passthrough:


https://docs.traefik.io/routing/routers/#configuring-tcp-routers

Regards,

jmc