TCP passthrough for HTTP connection with haproxy

Solution 1:

Yes, simply create a TCP listener forwarding to your servers. Of course in that case it becomes a layer 4 load balancer and you will not be able to use any layer 7 functions like path and host based routing.

Also make sure to use stickiness if your servers cannot share session information.

listen my_listener
    bind *:80
    mode tcp
    option tcplog
    balance leastconn
    server server1 1.2.3.4:80
    server server2 2.3.4.5:80

For SSL, just use 443.