How to configure Traefik 2 with TLS - Traefik 2 & TLS 101

First of all - thanks for this great tutorial. ...however... :slight_smile:

I'm trying to configure the TLS passthrough for one of the services running behind traefik

  1. I have a CA signed server certificate and the key
  2. all traffic is redirected from HTTP (port 80) to HTTPS (port 443)
  3. one service, nginx is configured w/out TLS, so traefik terminates the TLS connection and serves up the nginx page(s) fine
  4. another service (spring boot) on the other hand is configured to handle TLS by itself, so I need a passthrough configuration
  5. all of this runs on linux and docker-ce and traefik v2.10.7

Here's where I keep banging my head on the table:

working docker compose labels for my-app (without SSL enabled!)

services:
  ...
  labels:
    - traefik.enable=true
    - traefik.http.routers.my-app.entrypoints=websecure
    - traefik.http.routers.my-app.tls=true
    - traefik.http.routers.my-app.rule=Host(`my-host`) && PathPrefix(`/my-path`)
    - traefik.http.services.my-app-service.loadbalancer.server.port=8080

when I enable SSL in my-app and the same configuration above (using port 8443), I get this error:

Bad Request
This combination of host and port requires TLS.

when I try to add the tcp routers for TLS passthrough I get stuck. The routing is not picking up the PathPrefix and directs the request to nginx which in turn responds with a 404 Not Found for /my-path

  #- traefik.http.routers.my-app.tls=true
  - traefik.tcp.routers.my-app.rule=HostSNI(`my-host`)
  - traefik.tcp.routers.my-app.tls.passthrough=true
  - traefik.tcp.routers.my-app.entrypoints=websecure

what am I missing?

PS: the certificate works fine when I run my-app outside of traefik