Re: [squid-users] squid 3.2 and error_map equivalent

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sat, 23 Mar 2013 14:14:58 +1300

On 23/03/2013 4:57 a.m., Martin Sperl wrote:
> Hi!
>
> Is there an equivalent for the squid 2.X error_map functionality?
>
> Depending on context we would need to provide different error messages and text customizations.
>
> The error_map config would have been an ideal match for my requirements - a small apache with mod_rewrite could easily get "abused" for that (including a policy framework which pages to deliver for which portion of the reverse-proxy URL, which virtual host does get accessed,...)
>
> Is there any different means to do that in an elegant manner that does not require icap or similar?

Not exactly. You are the first person to ask for it in that last 3
years, so no emphasis was made on porting the feature across.

error_map simpy replaces *all* upstream responses with the mapped status
code, using the same custom template. So it would not seem to meet your
"depending on context" requirement anyway.

Try this:
   acl 404 http_status 404
   deny_info YOUR_404_PAGE 404
   http_reply_access deny 404

... etc. Which should replace the server-provided content with
YOUR_404_PAGE *and* allows other ACLs n the reply rule set to determine
whether or not your page is to be mapped in.

Amos
Received on Sat Mar 23 2013 - 01:15:10 MDT

This archive was generated by hypermail 2.2.0 : Mon Mar 25 2013 - 12:00:06 MDT