Time for action – combining ACLs and HTTP access
Let's have a look at a few cases for controlling HTTP access using example ACLs. When we have multiple access rules, Squid matches a particular request against them from top to bottom and keeps doing so until a definite action (allow
or deny
) is determined. Please note that if we have multiple ACLs within a single access rule, then a request is matched against all the ACLs from left to right, and Squid stops processing the rule as soon as it encounters an ACL that can't identify the request. An access rule with multiple ACLs results in a definite action, only if the request is identified by all the ACLs used in the rule.
acl my_home_machine src 192.0.2.21 acl my_lab_machine src 198.51.100.86 http_access allow my_home_machine http_access allow my_lab_machine
The ACLs and access rules in the previous code will allow hosts 192.0.2.21
and 198.51.100.86
to access the proxy server. The aforementioned access rules may also be written as:
acl my_machines...