I use the fictional domain name backend.mydomain.com instead of the domain that is acually used for the sake of this question.
I am moving a microservice into a docker environment where traefik proxy is used. I need the service to be reachable via https:://backend.mydomain.com:8080/ .
Other Services run as docker containers that use the default 443 port with their domains, but this specific Service must additionally be reachable on port 8080 via https.
For this purpose, in traefik.yml we have defined
entryPoints:
http:
address: ":80"
http:
redirections:
entryPoint:
to: https
scheme: https
https:
address: ":443"
http:
tls:
certResolver: http-resolver
myservice:
address: ":8080"
http:
redirections:
entryPoint:
to: https
scheme: https
And on the docker-compose definition for the corresponding Microservice:
myservice:
#...
labels:
- "traefik.enable=true"
- "traefik.http.routers.myservice.entrypoints=https,myservice"
- "traefik.http.routers.myservice.rule=Host(`backend.mydomain.com`)"
- "traefik.http.services.myservice.loadbalancer.server.port=8080"
Within its container the service runs on port 8080 as well, hence the last line in the docker-compose file. However this approach does not solve my problem:
- It does forward from http to https with a 301 (staying on 8080 would probably be better, but the 301 is probably ok too)
- https://backend.mydomain.com:8080/ however gives me a 404 <- this is the problem
How do I get it to work? The traefik documentation on entrypoints doesn't really have a lot of info - Is my approach even the right one?
See also my related Stackoverflow post.