Traefik SSL for a service that runs on non-standard port

Solution 1:

From the traefik docs:

If a container exposes multiple ports, or does not expose any port, then you must manually specify which port Traefik should use for communication by using the label traefik.http.services.<service_name>.loadbalancer.server.port (Read more on this label in the dedicated section in routing).

So if whoami was listening on 8080 and didn't expose exactly one port, you should specify the label:

"traefik.http.services.whoami2.loadbalancer.server.port=8080"