Unfortunately there are quite a few subdomains, and we don't know them all as this is for a client, who will just be looking to add dns records and vhosts on the fly. What sort of work is required to add in this kind of functionality?
I've seen your previous warnings about 1.3.19 :)

Cheers
Chris

Sent from my iPhone

On 16 Oct 2009, at 22:09, Willy Tarreau <w...@1wt.eu> wrote:

Hi Chris,

On Fri, Oct 16, 2009 at 02:50:44PM +0100, ch...@sargy.co.uk wrote:

Hi Guys,

I have a wildcard SSL certificate which I wish to do a redirect from
http to https whilst maintaining the original subdomain requested, eg:

http://sub.domain.com/page should be redirected to
https://sub.domain.com/page

I can't do this with redirect_prefix (it seems to require I know the
destination in advance)

Can anyone point me in the right direction for this?

This would mean extract part of the "Host:" request header to build
the "Location:" response header. We planned to implement that at one
moment but it's still not done because there was no use of it yet.
Do you have a lot of domains in your wildcard certificate ? In a first
time you could write as many "redirect" rules as you have domains, if
that's not too many. For instance :

  acl name1 hdr(host) -i name1.domain.com
  acl name2 hdr(host) -i name2.domain.com
  acl name3 hdr(host) -i name3.domain.com
  redirect prefix https://name1.domain.com if name1
  redirect prefix https://name2.domain.com if name2
  redirect prefix https://name3.domain.com if name3

See ?

Using haproxy 1.3.19 on a Centos 5 machine.

Be careful with 1.3.19, it has a bug causing a random crash if you
forget to set some timeouts on some instances. So be careful to
have a defaults section with at least client/server/connect timeouts
set.

Regards,
Willy



Reply via email to