Can Traefik do virtual hosting as a network load balancer?

Slightly odd requirement, I know...

We have an HTTP based developer tool, and one of the things it can do is fail, including returning non-HTTP garbage bytes to the client & unexpectedly closing the TCP socket.

To save on IP addresses we want to put it behind a virtual hosting load balancer. Which means we need a slightly odd load balancer - kind of acting as an ALB / Layer 7 device for the request, but an NLB / Layer 4 device for the response, so that whatever the end product does with the response bytes gets passed straight through to the client. Most Layer 7 devices unsurprisingly want to turn garbage into a valid 5xx response to the client.

Is that something Traefik can do?

Thanks!

Hello @Mahoney and thanks for your interest in Traefik,

Is that something Traefik can do?

No, it is not possible to do something like that with Traefik.

Why not doing only Layer 4 routing? (using SNI or dedicated TCP ports)
See Traefik Routers Documentation - Traefik for more details.

1 Like

SNI - we need to support HTTP. We'd also probably prefer to be terminating TLS at an AWS NLB as well to take advantage of integration with their automatic TLS certificate management.

It's not clear to me how dedicated TCP ports would work... the client needs to initiate the request on the default 80/443 port. http://aaa.example.com and http://bbb.example.com both need to resolve to the same IP address, but need to be routed separately inside our infrastructure. I can't see how that can happen without looking at the Host header.

It's not clear to me how dedicated TCP ports would work... the client needs to initiate the request on the default 80/443 port. http://aaa.example.com and http://bbb.example.com both need to resolve to the same IP address, but need to be routed separately inside our infrastructure. I can't see how that can happen without looking at the Host header.

It is not possible, without relying on SNI/Host.

1 Like

Cool, thanks for confirming.