I'm wanting to intercept TCP traffic then forward everything else to their respective back-end servers. I have an internal DNS with matching domain to the wildcard external ingress.
I'm thinking something like the following, but I suspect this is not supported as HAProxy verifies the backend at start and this would not resolve to anything.
server all { req.hdr(host) }:443 check ssl verify none
My full configuration follows:
# This file is managed by Puppet global chroot /var/lib/haproxy daemon group haproxy log 172.22.91.180 local0 maxconn 4000 pidfile /var/run/haproxy.pid user haproxy defaults log global maxconn 8000 option redispatch retries 3 timeout http-request 10s timeout queue 1m timeout connect 10s timeout client 1m timeout server 1m timeout check 10s frontend waf-server bind 172.22.91.180:443 mode tcp option tcplog tcp-request inspect-delay 5s tcp-request content accept if { req_ssl_hello_type 1 } use_backend load-balancer if { req_ssl_sni -i rdg.example.com } default_backend reverse-proxy backend load-balancer balance roundrobin server blue rd1.example.com:443 check server green rd2.example.com:443 check backend reverse-proxy mode tcp server loopback-terminated abns@haproxy-terminate send-proxy-v2 frontend https-terminated mode http stats enable bind abns@haproxy-terminate accept-proxy ssl crt /etc/ssl/private/fullchain.cer use_backend jenkins if { req.hdr(host) -i jenkins.example.com } use_backend puppet if { req.hdr(host) -i puppet.example.com } backend jenkins mode http option forwardfor option http-server-close http-request set-header X-Forwarded-Port %[dst_port] http-request add-header X-Forwarded-Proto https http-response set-header Strict-Transport-Security "max-age=15552000; includeSubDomains" server jenkins jenkins.example.com:443 check ssl verify none backend puppet mode http option forwardfor option http-server-close http-request set-header X-Forwarded-Port %[dst_port] http-request add-header X-Forwarded-Proto https http-response set-header Strict-Transport-Security "max-age=15552000; includeSubDomains" server puppet puppet.example.com:443 check ssl verify none