LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Change ERR_CANNOT_FORWARD timeout (http://www.linuxquestions.org/questions/linux-software-2/change-err_cannot_forward-timeout-4175437895/)

4Paul4 11-19-2012 10:58 PM

Change ERR_CANNOT_FORWARD timeout
 
We have a few websites behind a squid reverse proxy server.
These servers are shutdown outside of business hours. During this time, squid displays the 'ERR_CANNOT_FORWARD' message which we have modified to display a friendly error message 'We are running between 9am - 5pm).

The problem is, this take approximately 80 seconds. We would like to change this to 20 seconds.

How would we go about doing this?

Squid info:
Code:

Squid Cache: Version 3.2.1
configure options:  '--build=x86_64-linux-gnu' '--prefix=/usr' '--enable-ssl' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--libexecdir=${prefix}/lib/squid3' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-silent-rules' '--srcdir=.' '--datadir=/usr/share/squid3' '--sysconfdir=/etc/squid3' '--mandir=/usr/share/man' '--with-cppunit-basedir=/usr' '--enable-inline' '--enable-async-io=8' '--enable-storeio=ufs,aufs,diskd' '--enable-removal-policies=lru,heap' '--enable-delay-pools' '--enable-cache-digests' '--enable-underscores' '--enable-icap-client' '--enable-arp-acl' '--with-filedescriptors=65536' '--with-large-files' '--with-default-user=proxy' '--enable-epoll' '--enable-linux-netfilter' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -g -Wall -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS=' 'CXXFLAGS=-g -O2 -g -Wall -O2' 'FFLAGS=-g -O2' '-with-openssl=/usr/include/openssl/' '--enable-http-violations'

OS Info:
Code:

Linux ip-10-0-0-36 3.2.0-25-virtual #40-Ubuntu SMP Wed May 23 22:20:17 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

hamlindsza 11-20-2012 12:54 AM

Check the configuration parameter: forward_timeout Try seting it to:
forward_timeout 20

If it still doesnt help, could you post your squid configuration here?

4Paul4 11-20-2012 04:48 PM

on the right track.
 
Quote:

Originally Posted by hamlindsza (Post 4833041)
Check the configuration parameter: forward_timeout Try seting it to:
forward_timeout 20

If it still doesnt help, could you post your squid configuration here?

Thanks for the reply. This does work (times out after 23-24 seconds) but it does not display the ERR_CANNOT_FORWARD message.
Instead,
chrome displays: "No data received" "Error 324(net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data".

Firefox displays: "The connection was reset."

4Paul4 12-16-2012 06:49 PM

So I am still stuck on this issue. I have added the following to the top of my squid.conf file:
Code:

forward_timeout 10.00 second
And it does work. After 11-12 seconds, squid stops trying to forward the request. The problem is, it simply terminates the connection without displaying an error page.
I would like it to show a custom error page or for starters, at least something rather than the browser saying "Firefox can't establish a connection to the server" or "No data received" - Chrome.

I am testing this by shutting down the peer's IIS web server so that squid cannot connect. If I remove the cannot_forward parameter, I I get the 110 second wait and then the ERR_CANNOT_FORWARD page as expected. I would like this same behavior to occur but after 10 seconds rather than 110.

Any ideas?

4Paul4 12-16-2012 08:38 PM

Figured it out.

Added connect-timeout=10 to the cache_peer line.


All times are GMT -5. The time now is 02:39 AM.