Squidguard redirect broken in 2.9.0 - workaround
-
Hi All,
I've updated a couple of systems from 2.8.2 to 2.9.0 and discovered that squidGuard blocking does not work depending on how you have it set up. I was previously using the redirect option to redirect it to the error page:

Where my.domain.com is the full hostname of pfsense. This worked on Squid 6.12 (PFSense 2.8.2) and earlier but does not work on Squid 7.4 as found in PFSense 2.9.0.
In cache.log you will see errors like
kid1| ERROR: URL-rewrite produces invalid request.A bit of sleuthing by ChatGPT found the following discussion, indicating that this type of rewrite (at least as the configuration is generated currently by PFSense) will no longer work with the CONNECT method using explicit proxy settings:
https://ml-archives.squid-cache.org/squid-users/2025-October/027677.html
The easiest workaround is to change it from redirect to found:

Instead of trying to do an internal rewrite to make Squid fetch the error page as if it was the original page, it sends a 302 found redirect back to the client and causes the client to go fetch the error page directly.
Depending on your network/firewall setup you may need to change your firewall rules to allow clients to connect to the port hosting the error page (eg the web interface) as previously they would only need access to the proxy port with the redirection occuring internally in Squid.
Not ideal, but if they can't connect to this port the function of blocking will still be achieved - they just won't see an error message.
If anyone knows a way to get the internal redirect working again instead of using a 302 redirect I'd be interested to know!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginPrivacy Policy · Cookie Policy