My config file:
defaults
mode http
maxconn 1024
option httplog
option dontlognull
retries 3
timeout connect 10s
timeout client 60s
timeout server 60s
listen stats
bind *:4443
stats enable
stats hide-version
stats uri /stats
frontend rotating_proxies
bind *:5555
use_backend ifconfig if { req.hdr(host) -i ifconfig.me }
use_backend ipinfo if { req.hdr(host) -i ipinfo.io }
mode http
backend ipinfo
balance leastconn # http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#balance
mode http
server web1 154.85.50.80:5222
server web2 154.85.70.80:5222
backend ifconfig
balance leastconn # http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#balance
mode http
server web1 154.85.100.80:5222
server web2 154.85.90.80:5222
I will map backend by incoming domain name, Haproxy should use backend ipinfo if incoming host is ipinfo.io, backend ifconfig if incoming host is ifconfig.me
On http request everything works.
On https side get error proxy aborted.
E.g.
curl -x 127.0.0.1:5555 http://ifconfig.me —> works
curl -x 127.0.0.1:5555 https://ifconfig.me —> Error proxy aborted
If i set default_backend on https side it works but i will map backend by https domain name.
BR