Hello everyone! I have got a Traefik instance, hosted in Docker, that is supposed to forward all traffic 1:1 to a server behind it:
docker-compose.yml
version: '3.8'
services:
traefik:
image: traefik:v2.10
restart: always
command:
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.file.directory=/config
- --providers.file.watch=true
- --entrypoints.websecure.address=:443
ports:
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /config:/config
My /config/routes.yml
:
tcp:
routers:
external-service-router:
rule: "HostSNI(`*`)"
service: "external-service"
entryPoints: ["websecure"]
services:
external-service:
loadBalancer:
servers:
- address: "IP_A:443"
This works, everything arrives at IP_A
successfully, which also responds to those requests. If I now change the Traefik config at runtime from IP_A
to IP_B
, it seems to work at first, too. The log states:
traefik-1 | time="..." level=debug msg="Creating TCP server 0 at IP_B:443" entryPointName=websecure routerName=external-service-router@file serviceName=external-service serverName=0
traefik-1 | time="..." level=debug msg="Adding route for \"HostSNI(`*`)\"" entryPointName=websecure routerName=external-service-router@file
And when I look at the (only temporarily activated) dashboard of Traefik, then the address for the service (IP_B
) is also correctly shown.
However: All traffic continues to go to IP_A
, it never arrives at IP_B
although that one is now configured. Only when I stop and restart the container does the change take effect.
What do I miss here?
Thanks!