[squid-users] custom error pages with stylesheets doesn't work for me

Amos Jeffries squid3 at treenet.co.nz
Fri May 19 13:40:11 UTC 2017


On 19/05/17 20:10, Dieter Bloms wrote:
> Hello Alex,
>
> On Thu, May 18, Alex Rousskov wrote:
>
>> On 05/18/2017 03:17 AM, Dieter Bloms wrote:
>>
>>> I wrote some custom error pages and activated style sheets in the header of the error pages like:
>>>
>>> <style type="text/css">
>>> %l
>>> </style>
>>>
>>> In the squid.conf file I set err_page_stylesheet to my stylesheet file and I restarted squid.
>>> My expectation was, that the content of this style sheet file will be included in the error page at the %l position.
>> Your expectation was correct.
>>
>>
>>> But the place between <style type="text/css"> and </style> is empty.
>>> Does anybody know how can I insert the content of the style sheet file to the error pages?
>> The steps you described above appear correct to me. Did you check for
>> errors in cache.log when starting Squid? Squid should complain if it
>> cannot load err_page_stylesheet but, unfortunately, Squid thinks that
>> you do not really care much about style and keeps running despite any
>> loading failures.
>>
>> Temporary renaming the stylesheet file (so that Squid cannot load it)
>> will help you test whether you are looking for errors in the right place.
> thank you for the hint.
> Squid had no read permission to this file. After right permissions
> it worked.
> But there was _no_ error message in the cache log file.
> I found the wrong permission with the help of strace command.
> It would be nice, when squid drop a note, that it can't read the file.

I just checked the code and do see a log entry being made at critical 
level. It does not say "ERROR" like most of those things should though, 
just the filename and the system error message (fixed that right now).

It may be that you missed it amongst the other informational startup 
messages, or that it is in the part of "cache.log" messages that are 
output before cache.log is opened - those lines currently go to stderr 
and/or your system messages log (where/what that is depends on your OS).

Amos



More information about the squid-users mailing list