当我们在haproxy里面需要使用use_backend或http-request等语句去调用定义过的acl规则时,可以跟平时写程序一样,使用与,或,非三种方式进行引用,比如:

1.正常写法

1
use_backend SOME-BACKEND if SOME-ACL

2.或者写法

1
2
use_backend SOME-BACKEND if SOME-ACL || OTHER-ACL
use_backend SOME-BACKEND if SOME-ACL || !OTHER-ACL

3.非(不符合)写法

1
2
use_backend SOME-BACKEND if !SOME-ACL
use_backend SOME-BACKEND if !SOME-ACL !OTHER-ACL

4.与(and)写法

1
2
use_backend SOME-BACKEND if ACL1 ACL2
use_backend SOME-BACKEND if !ACL1 ACL2