On Thu, May 17, 2012 at 2:41 PM, Willy Tarreau <w...@1wt.eu> wrote:
> Hi,
>
> On Wed, May 16, 2012 at 05:05:05PM +0200, hapr...@serverphorums.com wrote:
>> I think I am in this exact same boat. I have a site with wildcard subdomains
>> as well.
>>
>> Is there an ETA on this this pattern extraction? I browsed the changelogs up
>> through 5/14/2012 and it looks like there could be some possible headway on
>> this. Can someone please confirm?
>
> A lot of progress has indeed been made, but we still don't have such
> ability and it will take some time to implement.
>
>> Are there any other creative solutions for this? I need to redirect any
>> subdomain to https unless it is www.
>
> No idea right now. From what I understand you'd like to take the host
> header and put it into your redirects, prepended by "http://"; or "https://";
> depending on the type of redirection, that's it ?
>
> Maybe it should not be too hard to implement some "http-host" and
> "https-host" options to the "redirect" statement, as alternatives
> to "prefix", and which would automatically concatenate a scheme
> ("http://"; or "https://";) with the extract of the Host header and
> the current URI. I must say I have not much studied the idea, but
> it should be doable without too much effort.

This is how we currently do https redirects with haproxy and nginx:

in haproxy:

  use_backend https-redirect if { <something> }

backend https-redirect:
  server https-redir 127.2.0.1:80

in nginx:

server {
    listen 127.2.0.1:80;
    rewrite ^ https://$host$request_uri? permanent;
}

And we also do ssl termination with nginx, so the overhead of this
solution is minimal.

If haproxy could do both the ssl termination and the https redirect,
that would be something :)


- Finn Arne

Reply via email to