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...



On Fri, Oct 18, 2013 at 12:41 PM, Baptiste <[email protected]> wrote:

> Steven,
>
> In 1.5, the http-request rules are evaluated in the order they are written:
> "  The http-request statement defines a set of rules which apply to layer 7
>   processing. The rules are evaluated in their declaration order when they
> are
>   met in a frontend, listen or backend section. Any rule may optionally be
>   followed by an ACL-based condition, in which case it will only be
> evaluated
>   if the condition is true."
>
> The issue is that there is not yet a http-request rule for reqrep :/
>
> I also stated you could do your reqrep in the frontend, then do the
> redirect in a backend.
> That way, the rules should be evaluted in the order you expect.
>
> But maybe this is not compatible with your whole configuration
>
> Baptiste
>
>
> On Fri, Oct 18, 2013 at 10:30 AM, Steven Le Roux <[email protected]>
> wrote:
> >  "It is important to know that http-request rules are processed very
> early
> > in
> >   the HTTP processing, just after "block" rules and before "reqdel" or
> > "reqrep"
> >   rules."
> >
> > I can't reqrep before redirecting.
> >
> >
> > On Fri, Oct 18, 2013 at 8:00 AM, Baptiste <[email protected]> wrote:
> >>
> >> Hi steven,
> >>
> >> If you're using haproxy 1.5, then use http-request rules.
> >> Otherwise you could run your redirect rules in a backend.
> >>
> >> Baptiste
> >>
> >> Le 17 oct. 2013 23:28, "Steven Le Roux" <[email protected]> a écrit :
> >>
> >>> Hi,
> >>>
> >>> What I want to do is :
> >>>
> >>> acl p-static url_reg ^/context$
> >>> acl p-dynamic url_reg ^/context/.*$
> >>>
> >>> reqrep ^([^\ ]*)\ /context/(.*)     \1\ /\2 if p-dynamic
> >>>
> >>> redirect code 301 location http://host.domain.tld/context if p-static
> >>> redirect code 301 prefix http://host.domain.tld/contex/ressource?id=if
> >>> p-dynamic
> >>>
> >>>
> >>> and then the dynamic redirection to be suffixed by the modified
> request.
> >>>
> >>> As you noticed, redirect are processed before reqrep and I don't know
> how
> >>> to design this to have it working.
> >>>
> >>> Thanks for your help
> >>>
> >>> Regards,
> >>>
> >>>
> >>> --
> >>> Steven Le Roux
> >>> Jabber-ID : [email protected]
> >>> 0x39494CCB <[email protected]>
> >>> 2FF7 226B 552E 4709 03F0  6281 72D7 A010 3949 4CCB
> >
> >
> >
> >
> > --
> > Steven Le Roux
> > Jabber-ID : [email protected]
> > 0x39494CCB <[email protected]>
> > 2FF7 226B 552E 4709 03F0  6281 72D7 A010 3949 4CCB
>



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

Reply via email to