Reference
get acl
On this page
Test whether a value would match an ACL.
Description Jump to heading
This command returns a result that indicates whether a value would match an ACL expression. An ACL is found by its ID, which comes from the output of the command show acl. This is useful for debugging ACLs.
Examples Jump to heading
We start with the following ACL expression in the configuration, which checks whether the requested URL path begins with /images/:
haproxyfrontend wwwbind :80acl static_url path -i -m beg /images/
haproxyfrontend wwwbind :80acl static_url path -i -m beg /images/
Test a value against an ACL that you reference by its ID.
In the example below, we test the value /images/test.jpg against the ACL with an ID of 0:
nixecho "get acl #0 /images/test.jpg" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
nixecho "get acl #0 /images/test.jpg" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtexttype=beg, case=insensitive, match=yes, idx=list, pattern="/images/"
outputtexttype=beg, case=insensitive, match=yes, idx=list, pattern="/images/"
It returns match=yes.
See also Jump to heading
Do you have any suggestions on how we can improve the content of this page?