Inline base64 enconded images don't show up in error pages

Started by myksto, April 11, 2025, 10:48:50 AM

Previous topic - Next topic
Hi,
I'm on Opnsense 25.1.4_1-amd64 and trying to implement squid web proxy for a network.
Everything looks ok and works fine but the inline base64 image/logo doesn't appear in error pages, when using the squid pages and opnsense pages.
I've tried to implement custom error pages with a personal logo encoded with base64: the custom page show perfectly but not the logo.
I read againg and again the opnsense guide pages but I can't make it to work.
Do I have to activate anything in configuration? Do I have to add some line of code?
The stange fact is that the logo doesn't appear even ewith the standard error pages configuration.

Thanks a lot,
Michele.

Hi,

Did this issue appear with the 25.1.4 version or is this a general issue during setup?

Haven't heard of issues in this regard, but could be there although I'm trying to rule out updates as a cause as it seems unlikely.


Cheers,
Franco

Hi Franco,
to tell the truth this is the first implementation of Squid since a lot of time so I can't answer your question.
What I can say is that I tried to open default error pages and my custom error page (with css file in the same dir) outside the installation (on my pc) and the image is displayed correctly.
I attached 2 screenshots to explain:
Image_1 is the error page downloaded from opnsense and displayed on my pc
Image_2 is the error page displayed on a pc filtered by Opnsense/Squid (you can see on the upper left side that logo is missing)

Michele.

Can you check the browser console? It may complain about a security policy of inline images not being allowed.


Cheers,
Franco

Sorry,
what do you mean with "browser console"? What should I check?

Sorry again, I found it out.
What should I check anyway?

Thanks.

When you load the page it could complain im the console about a security policy blocking the inline image.

Open browser dev console. Reload the error page from squid. Post the messages the console offers.


Thanks,
Franco

Attached what you requested.
Anyway it looks stange to me it could be a browser problem, the error page is loaded with the inline image when it's local and not forwarded by Squid.

Thanks,
Michele.

This looks strange not allowing to pick up the static squid icons either, but first I'd check the source code of the page. SQuid is supposed to insert the CSS into the page and this should make the logo work unless the CSS has problems. Did you modify the CSS?


Cheers,
Franco

I modified the CSS for the code related to a new logo but I don't think it's the problem.
I resetted to standard error pages many times (using the GUI) and the problem was there.
Besides yesterday, when I first tried Squid and before modifying anything, the error page was exactly the same: error page without the image.

Thanks,
Michele

Sorry, not sure where this may fail at the moment and I'm unable to test this at the moment.

Maybe someone else can chime in?


Cheers,
Franco

It looks like Squid or Opnsense can't decode inline images.
What and where is the process that decodes those images?
Maybe a problem can be there??

Should I open a case in https://github.com/search?q=repo%3Aopnsense%2Fplugins+squid&type=issues

It's a pity noone helped. :(
I removed Squid in opnsense and setup a linux server with Squid where everything works like a charm.

Bye,
Michele.