Hi Craig,

On Tue, Apr 06, 2010 at 08:18:15PM +0200, Craig Craig wrote:
> Hi,
> 
> I'm currently using two frontends on different ports for SSL/non-SSL Traffic. 
> I run stunnel for SSL-termination, it forwards to one of the frontends.
> 
> Unfortunately, it seems that haproxy on the non-ssl backend can't redirect a 
> request to /$foo to https://mydomain.com/$foo ($foo is meant to be a 
> variable...). You can already guess why I want this: it be a nice option to 
> be able to fix websites/webapps with lots of hardcoded URLs to 
> http://mydomain.com so that they always get redirected to the secure version. 
> Not a very nice solution - I know.
> I guess, it would be the best thing to be able to use external scripts for 
> rewriting, what do you think?
> Or is it possible to do this cleanly with some option I haven't seen? I 
> thought about somehow rewriting headers, inserting a Location header etc. - 
> but could that work?

you can do that with "prefix" :

  redirect prefix https://mydomain.com

It will concatenate that prefix with the URI from the request and put that
in the location header. We also use it for http<->https redirects :-)

Regards,
Willy


Reply via email to