Re: [squid-users] Blocking spesific url

From: Andreas Westvik <andreas_at_spbk.no>
Date: Fri, 11 Jul 2014 09:50:17 +0200

Thanks for the reply everyone, I was trying to implement this in my squid.conf but 1) squid fails to restart 2)if it starts, no webpage will load.
I even tried to paste only the akamaihd\.net\/battlelog\/background-videos\/ in my �adserver� file as well but no dice.

Here is my (working) squid.conf without the acl.

http_port 192.168.0.1:3128 transparent
#Block
acl ads dstdom_regex -i "/etc/squid3/adservers"
http_access deny ads
acl LAN src 192.168.0.0/24
http_access allow LAN
http_access deny all
maximum_object_size 100 MB
cache_dir ufs /var/spool/squid3 5000 16 256

And here is the top of my /etc/squid3/adservers file

akamaihd\.net\/battlelog\/background-videos\/ <� Not working.
rd.samsungadhub.com
ad.samsungadhub.com
http://eaassets-a.akamaihd.net/battlelog/background-videos/naval-mov.webm$
(^|\.)serving-sys.com
tracking.xwebhub.net

On 10 Jul 2014, at 16:29, Alexandre <arekkusu.bug_at_gmail.com> wrote:

> My bad. I need to check squid ACL in more detail.
>
> I guess squidguard main advantage is speed when dealing with large list
> of URL then.
>
> Alexandre
>
> On 10/07/14 14:31, Leonardo Rodrigues wrote:
>> Em 10/07/14 09:04, Alexandre escreveu:
>>> Concerning blocking the specific URL. Someone correct me if I am wrong
>>> but I don't believe you can not do this with only squid.
>>> The squid ACL system can apparently block per domain:
>>> http://wiki.squid-cache.org/SquidFaq/SquidAcl
>>>
>>>
>> Of course you can block specific URLs using only squid ACL options !!
>>
>> # acl aclname url_regex [-i] ^http:// ... # regex matching
>> on whole URL
>> # acl aclname urlpath_regex [-i] \.gif$ ... # regex
>> matching on URL path
>>
>> if the URL is:
>>
>> http://eaassets-a.akamaihd.net/battlelog/background-videos/naval-mov.webm
>>
>> then something like:
>>
>> acl blockedurl url_regex -i akamaihd\.net\/battlelog\/background-videos\/
>> http_access deny block
>>
>> should do it ! And i not even include the filename which, i
>> imagine, can change between different stages.
>>
>>
>>
>
Received on Fri Jul 11 2014 - 07:50:26 MDT

This archive was generated by hypermail 2.2.0 : Fri Jul 11 2014 - 12:00:04 MDT