Hi Malcolm,

Not seen a reply to this, so here's my two penneth worth - currently,
you need to specify each domain you are redirecting to, yes - there's no
support in Haproxy for taking the host header you have supplied and
using it to figure out where you should be redirected to.

I believe this was on Willys todo list, but I'm not sure if he's got
anywhere near it yet.

Chris

-----Original Message-----
From: Malcolm Turnbull <malc...@loadbalancer.org>
To: haproxy@formilux.org
Subject: Can you do a HTTPS redirect to multiple sub domains?
Date: Wed, 19 Jan 2011 21:54:20 +0000

Willy et al.

I'm being lazy and asking the list without experimenting first but I
quite often get asked for redirecting port 80 -> HTTPS and I sugest:
// where 192.168.6.146 is the local stunnel/pound termination
"acl secure src 192.168.6.146
redirect prefix https://www.foo.com if !secure"

But a customer just asked:

Malcolm, we have a wildcard cert, which means there are a bunch of
domains terminating at the load balancer. I need to redirect each
subdomain independently:

http://dev1-foo.com --> https://dev1.foo.com

http://dev2-foo.com --> https://dev2.foo.com

http://dev3-foo.com --> https://dev3.foo.com

Is there no way to just do something like below(I know the asterisk is
not variable in this case).


"acl secure src 192.168.6.146
redirect prefix https://*.foo.com if !secure"

So all of the subdomains were caught in this rule?


So question is do I need to do a hdr acl test on each individual entry?
acl foo1 hdr dev-1.foo.com
if acl foo1 ....




--
Regards,

Malcolm Turnbull.

Loadbalancer.org Ltd.
Phone: +44 (0)870 443 8779
http://www.loadbalancer.org/




Reply via email to