Re: URL based redirecting

From: Willy Tarreau <w#1wt.eu>
Date: Tue, 9 Oct 2007 07:11:11 +0200


Hi Kaye,

[first, please avoid using HTML when posting to mailing lists]

On Tue, Oct 09, 2007 at 02:47:59PM +1000, Kaye Ng wrote:
> Hi,<br>
> <br>
> Just a simple question. Is it possible to configure HAProxy so that it:<br>
> <ul>
> <li>Redirects all requests for <a class="moz-txt-link-abbreviated" href="http://www.myapp.com/TestPage1.html">www.myapp.com/TestPage1.html</a> to web
> server 1 at port 100<br>
> </li>
> <li>Redirects all requests for <a class="moz-txt-link-abbreviated" href="http://www.myapp.com/TestPage2.html">www.myapp.com/TestPage2.html</a> to web
> server 2&nbsp; at port 200</li>
> <li>Redirects all other requests that come from <a class="moz-txt-link-abbreviated" href="http://www.myapp.com">www.myapp.com</a> to web
> server 3 at port 80<br>
> </li>
> </ul>
> In other words is it possible to configure HAProxy so that it does url
> based redirecting? <br>

Yes, take a look at examples/acl-content-sw.cfg and examples/content-sw-sample.cfg in haproxy 1.3, those are two methods to achieve what you're looking for. Also, take a look at doc/configuration.txt which explains how to use ACLs for this.

Regards,
Willy Received on 2007/10/09 07:11

This archive was generated by hypermail 2.2.0 : 2007/11/04 19:21 CET