Haproxy : Reverse Proxy Tcp

De www.yakakliker.org

Dans certains cas, le reverse proxy Tcp s'impose. Voici la configuration type

frontend MonTCP
    mode tcp
    bind *:3306
          
    default_backend TSE

backend TSE
    mode tcp
    balance leastconn
    server S1 192.168.1.50:3306 check
    server S2 192.168.2.50:3306 check
    stick-table type ip size 1m expire 30m

Exemple avec plusieurs backends

frontend SSL

mode tcp
bind *:443

tcp-request inspect-delay 5s
tcp-request content accept if { req_ssl_hello_type 1 }

use_backend backend1 if { req_ssl_sni -i site01.yakakliker.org }
use_backend backend2 if { req_ssl_sni -i site02.yakakliker.org }
use_backend bbackend3 if { req_ssl_sni -i site03.yakakliker.org }


backend backend1
mode tcp
server server1 192.168.0.100:443 check

backend backend2
mode tcp
server server2 192.168.0.101:443 check

backend backend3
mode tcp
server server3 192.168.0.102:443 check

Exemple avec plusieurs serveurs de destination

frontend https
	mode tcp
		option tcplog
		
	bind *:443

	tcp-request inspect-delay 15s
	tcp-request content accept if { req_ssl_hello_type 1 }

	use_backend www if { req_ssl_sni -i www.yakakliker.org }


backend www
    mode tcp
    balance source

    stick match src
    stick-table type ip size 200k expire 60m

    server WWW1b 10.0.0.29:443 check
    server WWW2b 10.1.1.29:443 check


Lien

https://www.haproxy.com/documentation/haproxy-configuration-tutorials/load-balancing/tcp/

https://discourse.haproxy.org/t/haproxy-forwarding-https-ok-tcp-not-ok-please-help/3872/5

https://www.haproxy.com/blog/introduction-to-haproxy-stick-tables

https://www.haproxy.com/documentation/haproxy-configuration-tutorials/core-concepts/stick-tables/

https://discourse.haproxy.org/t/mixing-mode-tcp-and-http-ssl-termination-and-passthrough/2698/16


compteur web gratuit sans pub