I'm using Squid 3.4 on Debian, and I want to know how to allow certain sub-URLs while banning the rest of them.
Particularly, I want to ban access to reddit.com/* but allow access to reddit.com/r/foo/* and reddit.com/r/foo/
acl bad url_regex reddit\.com.*
acl good url_regex reddit\.com.*foo*
http_access deny bad
http_access allow good
...
http_access allow localnet
http_access allow localhost
http_access deny all
This code doesn't seem to work, and everything at reddit.com ends up getting blocked. How can I get the configuration I want?
Edit: Updated configuration that still doesn't work:
acl good url_regex http(s)?://(www\.)?reddit\.com/r/foo.*
acl bad url_regex http(s)?://(www\.)?reddit\.com.*
http_access allow good
http_access deny bad
...
http_access allow localnet
http_access allow localhost
http_access deny all
This has the opposite effect of the previous code; it allows access to all of reddit.com (which I don't want).