Re: [squid-users] how to block special user-agent

From: Chris Robertson <[email protected]>
Date: Wed, 22 Nov 2006 12:12:06 -0900

Zhen Zhou wrote:
> Hi, all,
>
> I tried several ways to block some special user-agent in squid, but it
> didn't work as our request:
> 1. using acl xxx browser -i "Mozilla/4.0 (compatible; MSIE 5.00;
> Windows 98)"
> then system complain:
> 2006/11/22 09:16:36| strtokFile: Mozilla/4.0 not found
> 2006/11/22 09:16:36| aclParseAclLine: WARNING: empty ACL: acl xxx
> browser "Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)"
>
> 2. using header_access to filter, it still didn't get the result.
>
> any tips will be a great helpful, TIA
>
>
> Zhou

The double quotes tell Squid that you are putting the arguments in a
file (so it's looking for a file named Mozilla/4.0). If you don't use
quotes with that string, you will find problems with the parenthesis
(they are special characters in a regular expression).

Try this...

acl xxx browser -i Mozilla/4.0 \(compatible; MSIE 5.00; Windows 98\)

... and see if that matches better. Otherwise, shorten the string as
much as you can (use "MSIE 5", or "Windows 98" both without the quotes).

Chris
Received on Wed Nov 22 2006 - 14:12:30 MST

This archive was generated by hypermail pre-2.1.9 : Fri Dec 01 2006 - 12:00:03 MST