On Tue, Oct 28, 2014 at 5:42 PM, Conrad Hoffmann <[email protected]> wrote: > Hi, > > On 10/24/2014 02:12 PM, jeff saremi wrote: >> What is the order of evaluation of 'and's and 'or's in a use_backend clause? >> >> This is what the docs say: >> [!]acl1 [!]acl2 ... [!]acln { or [!]acl1 [!]acl2 ... [!]acln } ... >> >> and apparently i cannot use paranthesis to group them. However i need to >> write something like the following: >> use_backend some_backend if ( ( acl1 acl2) or (acl3 acl4) ) or acl5 > > Why not just break it down into several lines: > > use_backend some_backend if acl1 acl2 > use_backend some_backend if acl3 acl4 > use_backend some_backend if acl5 > > Especially if you care about the order of execution, this concern is > much more explicitly expressed this way. > > Regards, > Conrad > -- > Conrad Hoffmann > Traffic Engineer > > SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany > > Managing Director: Alexander Ljung | Incorporated in England & Wales > with Company No. 6343600 | Local Branch Office | AG Charlottenburg | > HRB 110657B >
I agree with Conrad. Just adding a piece of information here: HAProxy will process the use_backend as they are written. So the first matching will be used. Baptiste

