Re: Haproxy url Redirect - ???

From: Willy Tarreau <w#1wt.eu>
Date: Wed, 1 Oct 2008 00:34:12 +0200


Hi!

On Tue, Sep 30, 2008 at 03:38:39PM +0200, Dawid Sieradzki / Gadu-Gadu wrote:
> Hi!
>
> I have got some problem with url redirect in haproxy.
> Above is some snip configuration from pound,
> I can't so simple do that in haproxy.
>
> Question: There is some simple way in haproxy to redirect bad domain (the
> sister of oryginal domain:P ) to primary domain?
> HMM.
>
> Only one thing wich i did in haproxy is rewriting http header, section
> "Host: " to valid host, but i need to send 302 to client... to change uri
> client to valid.
>
> /Haproxy/
> ----8<---
> reqirep ^Host:\ web.gadugadu.pl Host:\ web.gadu-gadu.pl
> ---->9----
>
> Any idea? (i know there is option errorloc, but ... what? ;) )

I feel like what you need is simply "redirect ... if ..." which has been merged for 1.3.16 (not released yet). Under demands, I've put the patch online for 1.3.15 :

  http://haproxy.1wt.eu/download/patches/1.3.15-cond-redirect.diff

> / pound /
> ------------8<-----------
>
> Service
> HeadRequire "Host: .*web\.gadugadu\.pl$"
> URL ".*"
> Redirect "http://web.gadu-gadu.pl"
> End
> ------------->9----------

Hoping this helps!
Willy Received on 2008/10/01 00:34

This archive was generated by hypermail 2.2.0 : 2008/10/01 00:48 CEST