tcp-request content accept if { req_ssl_hello_type 1 } # TheSNI (ServerNameIndication) is not encrypted, so inspect the SSL hello forSNI # Spread the requests between backends use_backend bk_ssh if {req_ssl_sni -i ssh.example.com} use_backend bk_ftp if {req_ssl_sni -i ftp.example.com} use_backend bk_www if {req_ssl_sni -i www.example.com} default_backend bk_traditional
backend bk_ftp mode tcp server ftp ftp-nodes.example.com:21 check
backend bk_www mode http # This backend server will need to terminate TLSfor hola.example.com option http-keep-alive server www www-nodes.example.com:80 check inter 12000 errorfile 503 /etc/haproxy/error/maintenance.html errorfile 500 /etc/haproxy/error/500.html
tcp-request content accept if { req_ssl_hello_type 1 } # TheSNI (ServerNameIndication) is not encrypted, so inspect the SSL hello forSNI # Spread the requests between backends use_backend bk_agile if {req_ssl_sni -i agile.example.com} use_backend bk_hola if {req_ssl_sni -i hola.example.com} default_backend bk_traditional
backend bk_agile mode tcp # This backend server will need to terminate TLSfor agile.example.com server agile.internal.example.com:443 check
backend bk_hola mode tcp # This backend server will need to terminate TLSfor hola.example.com server hola.internal.example.com:443 check
backend bk_traditional mode tcp # This backend server will need to terminate TLS server traditional.internal.example.com:443 check
tcp-request content accept if { req_ssl_hello_type 1 } # TheSNI (ServerNameIndication) is not encrypted, so inspect the TLS hello forSNI # Spread the requests between backends use_backend bk_agile if {req_ssl_sni -i agile.example.com} default_backend bk_tcp_to_https
backend bk_tcp_to_https mode tcp server haproxy-https 127.0.0.1:8443 check
frontend ft_https mode http # HAProxy will take the fitting certificate from the available ones bind *:8443 ssl crt /etc/haproxy/certs/
# Spread the requests between backends use_backend bk_hola if {hdr(host) -i hola.example.com} default_backend bk_traditional
backend bk_agile mode tcp # This backend server will need to terminate TLSfor agile.example.com server agile.internal.example.com:443 check
backend bk_hola server hola.internal.example.com:80 check
backend bk_traditional server traditional.internal.example.com:80 check