[squid-users] Error page headers
rousskov at measurement-factory.com
Mon Sep 23 13:03:09 UTC 2019
On 9/23/19 12:49 AM, senor wrote:
> I have custom error pages with content needing the Content-Type
> header to reflect what it is (like JSON). I don't see any current
> options providing that option for error page handling.
I would start with http_reply_access/reply_header_replace combo, denying
the Content-Type response header in applicable Squid-generated error
responses (and only them) and then providing a replacement.
> Adaptation could work but seems like overkill.
There is not post-cache RESPMOD vectoring point support in Squid (and
most other proxies) -- adaptation is not applied to error pages.
You can also modify Squid sources, of course. This feature can probably
be quickly hacked into ErrorState::BuildHttpReply(). If you want
official admission, then a proper implementation would probably require
adding support for loading arbitrary response headers from the error
page template itself.
More information about the squid-users