Re: [squid-users] error pages on acl deny

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 27 Oct 2005 00:21:12 +0200 (CEST)

On Wed, 26 Oct 2005, Christoph Haas wrote:

> On Wednesday 26 October 2005 11:36, Metal Gear wrote:
>> hi guys i am now using the following acls i.e. i want different error
>> pages for different acls but i m always having a same error pages i.e.
>> of 'ERR_ACCESS_DENIED'. i think its priority is higher than the
>> second one.
>>
>> acl blockedsites url_regex "/usr/local/squid/etc/sites/block"
>> http_access deny blockedsites mydomain
>> deny_info ERR_ACCESS_DENIED blockedsites mydomain
>>
>> acl browserblocker browser -i 1.0.7
>> http_access deny !browserblocker mydomain
>> deny_info ERR_OLD_BROWSER_DENIED !browserblocker mydomain
>>
>> http_access allow mydomain
>>
>> how will i get the different error page?

deny_info looks for the very last acl of the http_access line which denied
access. Nothing more, nothing less. If you list multiple acls on the same
deny_info line then http_access deny lines ending in any of these acls
will show the indicated error message.

If you can not arrange your http_access deny statements in such manner
that the last acl on each line is something meaningful to use in deny_info
for selecting a suitable error message then it is possible to introduce
dummy acls similar to the "all" acl to connect things together with
deny_info.

> You need to define the deny_info before you use it in http_access.
> Just swap the lines.

No, the ordering of deny_info in relation to http_access is not important.
You can have all your deny_info lines first in squid.conf, or last if you
prefer, or mixed with your http_access lines.

Regards
Henrik
Received on Wed Oct 26 2005 - 16:21:21 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Nov 01 2005 - 12:00:05 MST