HaProxy & lets Encrypt Routing Question
-
Newbie question,
We have HaProxy routing all of our http traffic to various servers in the backend. This has been working properly for some time.
Now with Let's Encrypt we have created certificates for multiple domains and web sites and want to redirect the http traffic to the https port of HAProxy so that only HTTPS traffic is served.
In other words if you ask for http:xxx.abc.com or wdc.dfg.com your request will be automatically answered with the equivalent (offLoaded) ssl Https web site. We want the backend to remain http based but served as https with ssl offloading using let's encrypt.
We have created the SSL offloading frontend with the equivalent backend but at this point I must be brain dead since I don't see how I can reroute the http traffic to https.
Any help in this last step would be appreciated.
Thanks
-
Hi!
In frontend under advanced config add this to Advanced pass thru:
redirect scheme https if { hdr(Host) -i host.domain.com } !{ ssl_fc }
That should do it…