Re: [squid-users] Configure squid based on content type of http response (RESOLUTION)

From: Dmitry S. Makovey <dmitry@dont-contact.us>
Date: Thu, 01 Nov 2007 14:48:50 -0600

On October 31, 2007, Dmitry S. Makovey wrote:
> > #http_reply_access allow all
> >
> > acl plain_content rep_mime_type -i text/plain
> > # http_reply_access allow GET_method xml_content from_clients
> >
> > redirect_program /usr/local/bin/myscript
> > redirector_access plain_content
> >
> > http_reply_access allow all
>
> slightly modified version of this works on our boxes, with Squid2.5-STABLE3
> (RedHat AS3) limiting access to resources other than RSS feeds.

Update on this subject for history sake:

Our version didn't use redirector and I thought it would work, but it doesn't
as redirector seem to fire up *before* you can check your "reply" so
redirector_access never gets desired arguments and nothing gets redirected.
However going by the lead from Amos here's what worked in my test lab:

error_directory /var/tmp/
# redirector_bypass off
acl plain_content rep_mime_type -i text/plain
http_reply_access deny plain_content

deny_info ERR_PLAIN_TEXT plain_content

where /var/tmp/ERR_PLAIN_TEXT is a plaintext file with a message for users.

-- 
Dmitry Makovey
Web Systems Administrator
Athabasca University
(780) 675-6245

Received on Thu Nov 01 2007 - 14:48:57 MDT

This archive was generated by hypermail pre-2.1.9 : Sat Dec 01 2007 - 12:00:01 MST