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

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Mon, 25 Mar 2013 23:30:08 +1300

On 25/03/2013 10:55 p.m., Martin Sperl wrote:
> OK, this seems a reasonable enough approach (but not ideal with the redirect) - I will give it a try.

There is no redirect unless you specify an external URL location in
deny_info.
Use a static template / filename at that will be injected as the
delivered object.

In the latest Squid you can supply an alternative 4xx error code and a
template in deny_info.
ie. deny_info 499:/etc/squid3/Kittens all

> The primary use is that we want to catch the icap errors (in case the icap-server is down) or "502 - Bad gateway"...
>
> An additional question: how can I detect if the 502/... have been generated by squid and not by the upstream servers? (so that the error page redirect only happens in those cases)

That is an entirely different problem to the one you have been talking
about so far.

To replace just the page Squid is generating you do not have to
configure anything. Just remove all the installed
errors/*/ERR_BAD_GATEWAY translation files, and replace the
errors/templates/ERR_BAD_GATEWAY one with your custom static page. You
can optionally provide translated versions of your custom page too of
course.

Amos
Received on Mon Mar 25 2013 - 10:30:14 MDT

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