I have this scenario
some connections income to my HAProxy server on HTTPS and port 443 & 440
Connections sni are : subbbx.example1.com and subyyyyy.example2.com (for example)
What I need :
When incoming connection have example1.com and any subdomain the connection forward to IP1 When incoming connection have example2.com and any subdomain the connection forward to IP2 Else on any other sni connection forward to IP3
May provide me config ?
Note : HAProxy server does not have sll cert. but ip1 server and ip2 server and ip3 server have cert related to sni
Thanks
Because I am zero at HAProxy I dont know how to do that
Untested, but this snippet seems to do what you want:
Change the backend IP addresses, and change
.aaa.domain.comand.bbb.domain.comto.example1.comand.example2.comfor your case. Since it usesreq_ssl_sni -m end, it should match any subdomain, like you want.Note that this won't work for connections using Encrypted SNI, since the SNI won't be visible by HAProxy in passthrough mode.