I want to configure simple redirect with HAproxy.
Desired behaviour: HAProxy receives request to example.com or https://example.com and returns https webserver start page from servers list excluding itself from a chain.
I tried with redirect location https://web1.com code 301 if example_acl
and it works for single server but I need 5 servers behind redirect, with web1.com, web2.com ... and round-robin. Maybe there is some specific config for backend section? please help
My current config is
-#------------------- GLOBAL SETTINGS ---------------------------
...
-#------------------- FRONTEND HTTP ---------------------------
frontend http_in
mode http
option httplog
bind *:80
stats enable
redirect scheme https if { hdr(Host) -i example.com }
-#------------------- FRONTEND TCP ---------------------------
frontend tcp_in
mode tcp
option tcplog
bind *:443
tcp-request inspect-delay 5s
tcp-request content accept if { req.ssl_hello_type 1 }
acl example_acl req.ssl_sni -i example.com
use_backend special_example if example_acl
-#------------------- Server Farms ---------------------------
backend special_example
mode tcp
balance roundrobin
?