Re: [squid-users] Squid as transparent proxy show squid error pages in browser

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 10 Jan 2013 22:20:59 +1300

On 10/01/2013 9:38 p.m., Frantisek Remias wrote:
> Hello,
> thank you for the response.
>
> If I set the browser to use proxy a there is temporarily no internet
> connection..then it shows the custom page (the ERR_DNS_FAIL one). BTW:
> Is it possible to define another custom page when the internet
> connection is not available (so it will shows different one when there
> is DNS problem and another if internet connection is unavailable?)

How is Squid to know about connection unavailable? It is not making a
connection, just doing DNS lookup at this point to determine where the
connection might go in future. It is entirely possible (and normal) that
routing make the DNS go through one upstream link and HTTP packets
through another.

> If I dont set the browser to use proxy (meaning it will use
> transparent mode proxy). It shows default browser error message like
> "Internet Explorer cannot display the webpage" or "Server not
> found...Firefox cant found the server at www.".... in firefox. What I
> need is to show the squid custom page in this case there isnt internet
> connection available

Interfaces these days offer scripted hooks. So...

You configure Squid with:
   http_port 3128 intercept name=port1
   http_port 3129 intercept name=port2
   acl port2 myportname port2
   deny_info ERR_CUSTOM port2
   http_access deny port2

Then you make a script which changes the iptables rules sending traffic
to port #2 of Squid when the link goes down and sending traffic to port
#1 of Squid when it goes up.

Amos
Received on Thu Jan 10 2013 - 09:21:06 MST

This archive was generated by hypermail 2.2.0 : Thu Jan 10 2013 - 12:00:03 MST