Great willy as usual :)

BUT :)

There is still a / I can't remove... : got search=/<arg>  instead of
search=<arg>




On Fri, Oct 18, 2013 at 4:37 PM, Willy Tarreau <[email protected]> wrote:

> Hi Steven,
>
> On Fri, Oct 18, 2013 at 01:40:13PM +0200, Steven Le Roux wrote:
> > frontend app
> >   bind *:80
> >   acl p-static      url_reg  ^/context$
> >   acl p-dyn      url_reg  ^/context/.*$
> >   reqrep ^GET\ /context/(.*)     GET\ \1 if p-dyn
> >   redirect code 301 location https://host.domain.tld/context if p-static
> >   use_backend app if p-dyn
> >
> > backend app
> >   redirect code 302 prefix https://host.domain.tldt/context/?search=
> >
> >
> > it's not working for me...
>
> It's normal. The problem is not the ordering between your reqrep and
> the redirect, as the redirect is performed *after* reqrep. The problem
> is that the condition to perform the redirect is not matched anymore
> after the reqrep was performed.
>
> Please use a specific backend for both the transformation and the
> redirect, in order not to have to rely on a condition that changes
> in the middle of the operations :
>
>  frontend app
>    bind *:80
>    acl p-static      url_reg  ^/context$
>    acl p-dyn      url_reg  ^/context/.*$
>    redirect code 301 location https://host.domain.tld/context if p-static
>    use_backend app if p-dyn
>
>  backend app
>    reqrep ^GET\ /context/(.*)     GET\ \1
>    redirect code 302 prefix https://host.domain.tldt/context/?search=
>
> With this, it will work.
>
> Regards,
> Willy
>
>


-- 
Steven Le Roux
Jabber-ID : [email protected]
0x39494CCB <[email protected]>
2FF7 226B 552E 4709 03F0  6281 72D7 A010 3949 4CCB

Reply via email to