LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-19-2012, 10:58 PM   #1
4Paul4
Member
 
Registered: Jul 2011
Posts: 51

Rep: Reputation: Disabled
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
 
Old 11-20-2012, 12:54 AM   #2
hamlindsza
Member
 
Registered: Aug 2012
Distribution: Debian, CentOS
Posts: 74

Rep: Reputation: Disabled
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?
 
1 members found this post helpful.
Old 11-20-2012, 04:48 PM   #3
4Paul4
Member
 
Registered: Jul 2011
Posts: 51

Original Poster
Rep: Reputation: Disabled
on the right track.

Quote:
Originally Posted by hamlindsza View Post
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."
 
Old 12-16-2012, 06:49 PM   #4
4Paul4
Member
 
Registered: Jul 2011
Posts: 51

Original Poster
Rep: Reputation: Disabled
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?
 
Old 12-16-2012, 08:38 PM   #5
4Paul4
Member
 
Registered: Jul 2011
Posts: 51

Original Poster
Rep: Reputation: Disabled
Figured it out.

Added connect-timeout=10 to the cache_peer line.
 
  


Reply

Tags
proxy, server, squid, squid3, ubuntu 12.04


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to Change Inactivity Timeout The Old Crab Linux - General 2 03-26-2010 12:00 PM
change the timeout on boot billb Linux - General 7 12-25-2004 09:40 PM
connect() timeout change nodger Programming 11 09-13-2004 07:01 PM
change GRUB timeout Gijet Red Hat 3 02-12-2004 10:53 AM
how to change telnet timeout? qnguyendang Linux - Networking 0 02-17-2003 04:13 AM


All times are GMT -5. The time now is 09:14 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration