RE: use_backend complex rules

From: Zbynek Vymazal <zv#zmags.com>
Date: Tue, 3 Aug 2010 13:41:53 +0200


Hi Gerardo,

The ACL rules are using disjunctive normal form (DNF) to form conditions (http://en.wikipedia.org/wiki/Disjunctive_normal_form). See HAproxy configuration manual section 7.7 (for 1.3.x version).

I think your rule should look like this:

use_backend rule-csp if mydom1 req_xxx_path or mydom1 req_yyy_path or mydom2 req_xxx_path or mydom2 req_yyy_path

Zbynek

From: Gerardo Corro [mailto:rob_gar_esp#hotmail.com] Sent: Tuesday, August 03, 2010 12:18
To: haproxy#formilux.org
Subject: use_backend complex rules

Hi HA people,

I had a simple use_backend rule that works:

acl req_xxx_path path_beg /xxx
acl req_yyy_path path_beg /yyy
use_backend rule-csp if req_xxx_path or req_yyy_path

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)

The previous snippet is not working, How can I make it work?

Thanks in advanced, Received on 2010/08/03 13:41

This archive was generated by hypermail 2.2.0 : 2010/08/03 13:45 CEST