Re: use_backend complex rules

From: Chris Sarginson <chris#sargy.co.uk>
Date: Tue, 03 Aug 2010 12:59:41 +0100


By default doesn't haproxy use AND when matching ACLs?

If so the last line should be:

use_backend rule-csp if mydom req_path

Gerardo Corro wrote:
> Hi,
>
> Thanks for your email, however "and" conditions don't work.
>
> Is there a workaround? Is there a way to group conditions like if ( x
> and t) or (d or f)
>
> Best regards
>
>
>
>
> > Date: Tue, 3 Aug 2010 12:35:31 +0200
> > From: Olivier.LeCam#crdp.ac-versailles.fr
> > To: rob_gar_esp#hotmail.com
> > CC: haproxy#formilux.org
> > Subject: Re: use_backend complex rules
> >
> > Hi -
> >
> > Gerardo Corro wrote:
> > > However I need to make it more complex, it has to filter two possible
> > > domains, so I defined these conditions:
> > >
> > > acl mydom1 hdr_dom(host) -i www.mydom1.com
> > > acl mydom2 hdr_dom(host) -i www.mydom2.com
> > > acl req_xxx_path path_beg /xxx
> > > acl req_yyy_path path_beg /yyy
> > > use_backend rule-csp if (mydom1 or mydom2) and (req_xxx_path or
> > > req_yyy_path)
> >
> > You might try:
> >
> > acl mydom hdr_dom(host) -i www.mydom1.com
> > acl mydom hdr_dom(host) -i www.mydom2.com
> > acl req_path path_beg /xxx
> > acl req_path path_beg /yyy
> > use_backend rule-csp if mydom and req_path
> >
> > Not tested here with a 'and' condition in the use_backend directory but
> > having multiple acls with the same name just works for me (rules are
> > managed as an 'or' condition between all of them) with
> v1.3.15.2-2+lenny2.
> >
> > HTH
> > --
> > Olivier
Received on 2010/08/03 13:59

This archive was generated by hypermail 2.2.0 : 2010/08/03 14:15 CEST