Reference

del acl

Delete a single value from an ACL expression or file.

Description Jump to heading

An ACL is split into four parts:

  • a name for the ACL, which you choose
  • a fetch to collect information from the client’s session
  • optional flags
  • a value to match against

In the example below, we mark these parts:

haproxy
frontend www
bind :80
# name fetch flags value
acl static_url path -i -m beg /images/ /scripts/
haproxy
frontend www
bind :80
# name fetch flags value
acl static_url path -i -m beg /images/ /scripts/

Here, there is initially two values, /images/ and /scripts/. Use del acl to delete a value.

You can also store values in a file and then reference that file in an acl statement by using the -f /path/to/file flag. Use the del acl command to delete a value to the file. Note that this only removes it from the load balancer’s runtime memory and not to the file on disk.

Examples Jump to heading

In this example, we demonstrate two ways to delete an ACL from runtime memory. The first way references the ACL by its unique identifier. The second way uses its path-based name.

  1. Use del acl to remove the value /scripts/. Pass to it the ID of the ACL:

    bash
    echo "del acl #0 /scripts/" | \
    sudo socat stdio tcp4-connect:127.0.0.1:9999
    bash
    echo "del acl #0 /scripts/" | \
    sudo socat stdio tcp4-connect:127.0.0.1:9999

    This updates the ACL so that it represents this expression:

    haproxy
    frontend www
    bind :80
    acl static_url path -i -m beg /images/
    haproxy
    frontend www
    bind :80
    acl static_url path -i -m beg /images/

In the next example, we remove the value /stylesheets/ from the ACL file /etc/hapee-2.8/paths.acl:

bash
echo "del acl /etc/hapee-2.8/paths.acl /stylesheets/" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
bash
echo "del acl /etc/hapee-2.8/paths.acl /stylesheets/" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999

See also Jump to heading

If this page was useful, please, Leave the feedback.