I have a single SSL eg.
www.abc.com.
Im trying to get haproxy to accept any request eg. xyz.com or ijk.com to redirect to
https://www.abc.com. Is this possible?
#---------------------------------------------------------------------
# main frontend for XXX which proxys to the backends
#---------------------------------------------------------------------
frontend sslApp443
mode http
bind XXX.XXX.XXX.XXX:80
bind XXX.XXX.XXX.XXX:443 ssl crt /etc/haproxy/certs/mailapplab.crt
option http-server-close
option forwardfor
reqadd X-Forwarded-Proto:\ https
redirect scheme https if !{ ssl_fc }
default_backend AppWebSSL443
#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
backend AppWebSSL443
mode http
balance roundrobin
option httpchk HEAD / HTTP/1.0
cookie SERVERID insert indirect
server LABAPP01SSL XXX.XXX.XXX.XXX:80 cookie LABAPP1 check inter 2000 rise 2 fall 5
server LABAPP02SSL XXX.XXX.XXX.XXX:80 cookie LABAPP2 check inter 2000 rise 2 fall 5
---------- Post updated at 06:00 PM ---------- Previous update was at 04:08 PM ----------
Its ok.. I managed to figure this out.
acl correctdomain hdr(host) www.abc.com
mode http
bind xxx.xxx.xxx.xxx:80
bind xxx.xxx.xxx.xxx:443 ssl crt /etc/haproxy/certs/mailapplab.crt
redirect location https://www.abc.com if !correctdomain