Re: [squid-users] Custom error 400 page

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 29 Apr 2011 00:35:04 +1200

On 28/04/11 17:56, Morgan Storey wrote:
> Hi Everyone,
>
> Playing around with reverse proxying with cache, and I have a bit of a
> problem some of the pages are using 302 redirects, so I can't cache
> them. If the webserver goes down it will return an http error 400, can
> I customise an error page in: C:\squid\share\errors\English, if so
> which one, or do I make a new one?
> This is the line from the access.log:
> 1303970032.096 15 127.0.0.1 TCP_MISS/400 323 GET
> http://www.site.com/about.aspx - FIRST_UP_PARENT/myAccel text/html
>

Web server generated 4xx errors are handled by Squid exactly the same as
success 2xx replies. ie passed straight back to the client.

If you have squid-2.7 there is an error_map directive available that
replaces the server errors with something new. Be aware that it has a
bug in the content-type, so if the server is being fancy and gzipping
the error page Squid will screw up and send plain text marked as compressed.

That directive has not yet been ported to squid-3. You can probably hack
around that with 3.1+ by using the http_status ACL to deny
http_reply_access for 400 responses. Matched with a deny_info to bounce
out the alternative custom reply.
  Note: I have not tried this so it may not work.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.12
   Beta testers wanted for 3.2.0.7 and 3.1.12.1
Received on Thu Apr 28 2011 - 12:35:09 MDT

This archive was generated by hypermail 2.2.0 : Thu Apr 28 2011 - 12:00:03 MDT