I have tried to use regular expression, but without luck.
We have a SSL wildcard sertificate for *.foobar.com and which to add use a redirect like this:
redirect schema https if { hdr(host} -i ^.*\.foobar\.com } !{ ssl_fc }
but without luck. I ended up with a lot of lines like this:
redirect schema https if { hdr(host) -i a.foobar.com } !{ ssl_fc }
Which cause a lot of extra maintenance each time we add a new x.foobar.com host. We need this since we also have a few customers that do not use SSL (like x.otherdomain.net) and they shall not be redirected to use https.
Is there a way to make haproxy support wildecard with redirect as described above?