I have traefik v 2.11 and custom TCP server started via docker-compose.yaml and this works fine. Is there a way for traefik (configuration) to drop or close connection when the TCP server is stopped. At the moment any existing client to the TCP server will still be connected and new client will connect to the designated port.
Not an expert, but I don’t think that works.
Traefik is not build for a homelab with a single service behind it, where it would close the port when it’s unavailable.
It purpose is rather for larger infrastructure with replicated services, where you want to connect to the next available service as fast as possible if one replica goes down.
Also usually multiple services run through the same port, so Traefik still needs to accept connections to check the target Host/HostSNI.
Well it should be dropping or blocking connection if all backend disappear or stopped.
That’s you line of thought, I personally disagree. Of course you could submit that as an issue or feature request on Traefik Github to get some feedback from the developers.
It seems you are the first one interested in this in many thousand posts here. From my experience the devs usually don’t implement niche use cases, so don’t have high expectations.