I need nested ACL conditions
acl route1 hdr_sub(host) -i abc.com hdr_sub(host) -i xyz.com
acl route2 path_beg /m1
acl route3 path_beg /m2
use backend back1 if route1 (route2 or route3)
// essentially
route1 AND (route2 OR route3)
to match backends. What would be the correct HA code equivalent to this ?
Access Control Lists, or ACLs, in HAProxy allow you to test various conditions and perform a given action based on those tests.
Access Control List (ACL) rules allow an admin to limit the permissions of users in Magento. For example, you can use ACL rules to authorize the users to access menus, controllers, API endpoints and conditionally render layout blocks.
Rules in a single ACL are ORed, so, you can combine the route2
and route3
rules with this:
acl route2 path_beg /m1
acl route2 path_beg /m2
use backend back1 if route1 route2
Conditions also support the ||
operator, but not parenthetical grouping for precedence, so a b || c
means (a and b) or (c)
, which isn't equivalent to what you want... so if you don't want to combine the ACLs as shown above, you would need this...
use backend back1 if route1 route2 || route1 route3
...which is not exactly intuitive.
Or this:
use backend back1 if route1 route2
use backend back1 if route1 route3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With