Search squid archive

Re: Custom error 400 page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux