[squid-users] Error page headers

senor frio_cervesa at hotmail.com
Mon Sep 23 17:08:58 UTC 2019

Thank you Alex. I suspected I was missing something. In this case I didn't realize the error page would still need to flow through http_reply_access/reply_header_replace. I think that's what I need.

I didn't want to touch the code unless I could do something as complete as what you described. It's an enticing project for when extra time comes my way.


From: squid-users <squid-users-bounces at lists.squid-cache.org> on behalf of Alex Rousskov <rousskov at measurement-factory.com>
Sent: Monday, September 23, 2019 6:03 AM
To: squid-users at lists.squid-cache.org
Subject: Re: [squid-users] Error page headers

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.

squid-users mailing list
squid-users at lists.squid-cache.org

More information about the squid-users mailing list