Re: Redirect Question

From: Willy Tarreau <w#1wt.eu>
Date: Fri, 26 Feb 2010 22:36:04 +0100


On Fri, Feb 26, 2010 at 01:24:25PM -0800, Sriram Chavali wrote:
> I have written a rule in my haproxy configs to redirect the incoming request to a certain page based on an acl rule being satisfied. It looks like as following:
> redirect location http://server:port/violation.html if acl_met
>
> The redirected page is on the same server - however I don't want the redirected server's name and port to show up in the redirected URL that he client sees in his browser. I want the base URL (http://www.mysite.com) to be preserved for this redirected page. How can I accomplish this? Do I need to use a directive other than redirect?

If the page is at the same place, use a relative location instead :

     redirect location /violation.html if acl_met

It's a lot cleaner.

Regards,
Willy Received on 2010/02/26 22:36

This archive was generated by hypermail 2.2.0 : 2010/02/26 22:45 CET