Centos – Display a message to all Squid Proxy users

centossquid

I have a production squid proxy that I am about to decommission soon. The proxy has about 400 users mainly at remote location. We have purchased a new proxy appliance and it is ready for use.

At this point of time, I can customize an error page with details on how to configure proxy settings and then disable access to all site so that these users can see this error page. But I prefer not to as the users would probably get confused and helpdesk will be flooded with calls.

I am thinking of displaying a reminder to the proxy users on the cut off date and instructions on how to configure proxy setting on their PC and they would need to click on a button to resume browsing.

Is there anyway I can achieve this with Squid Proxy? The proxy operates on a CentOS with Apache installed.

Best Answer

Squid supports custom error pages, take advantage of this.

In a directory (just use the default one, /usr/share/squid/errors on my system), create your info page without any extension (for example /usr/share/squid/errors/MY_CUSTOM_INFO_PAGE), then in Squid's config create an ACL that will match all the requests you want to redirect to the info page, deny access for that ACL and use the deny_info directive to serve that custom page :

deny_info MY_CUSTOM_INFO_PAGE myacl

You can also specify an URL to which the users will be redirected, just make sure that URL does not trigger the deny ACL, otherwise you'll create a redirect loop that can potentially DoS your server :

deny_info http://some/online/error/page myacl

Note that when using a custom error page (not an URL) you'll need to set the error_directory directive as well, unless you're ready to translate your error page in each one of the languages stored in the error page directory :

error_directory /usr/share/squid/errors
Related Topic