Eduardo Maia ha scritto:
Hello,
When access to http://www.tyco-fsbp.com/cgi-bin/webscripts/nph-home.pl
with squid 3.0.STABLE1 or squid-3.1.0.15 i got the error below. If i
access directly without proxy the website opens.
What could be the problem?
ERROR
The requested URL could not be retrieved
While trying to process the request:
GET /cgi-bin/webscripts/nph-home.pl HTTP/1.0
User-Agent: Opera/9.64 (X11; Linux i686; U; en) Presto/2.1.1
Host: www.tyco-fsbp.com
Accept: text/html, application/xml;q=0.9, application/xhtml+xml,
image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Accept-Language: en-US,en;q=0.9
Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1
Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
Referer: http://www.tyco-fsbp.com/
Pragma: no-cache
Cache-Control: no-cache
Proxy-Connection: Keep-Alive
The following error was encountered:
Invalid Response
The HTTP Response message received from the contacted server could not
be understood or was otherwise malformed. Please contact the site
operator. Your cache administrator may be able to provide you with more
details about the exact nature of the problem if needed.
Your cache administrator is webmaster.
thanks,
Eduardo
Hallo,
the problem is your script is not generating the correct HTTP headers.
Web browsers are written to render the highest possible number of sites,
so are very forgiving when they find errors in the http stream.
Squid is instead much stricter in this regard.
Try wget -S against your site and another site which loads well through
the http proxy.
Here's an example:
marcello@marcello-laptop:~$ wget -S www.cineca.it
--2010-01-25 22:25:19-- http://www.cineca.it/
Risoluzione di www.cineca.it... 130.186.1.46
Connessione a www.cineca.it|130.186.1.46|:80... connesso.
HTTP richiesta inviata, in attesa di risposta...
HTTP/1.1 200 OK
Date: Mon, 25 Jan 2010 21:25:19 GMT
Server: Apache/1.3.36 (Unix) PHP/4.4.2 mod_auth_ianus_sso/1.15
DAV/1.0.3 mod_ssl/2.8.27 OpenSSL/0.9.8b mod_jk/1.2.15
Last-Modified: Fri, 22 Jan 2010 21:58:52 GMT
ETag: "b52a-622a-4b5a1f9c"
Accept-Ranges: bytes
Content-Length: 25130
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Lunghezza: 25130 (25K) [text/html]
Salvataggio in: "index.html"
100%[=======================================================>] 25.130
54,2K/s in 0,5s
2010-01-25 22:25:19 (54,2 KB/s) - "index.html" salvato [25130/25130]
marcello@marcello-laptop:~$ wget -S
http://www.tyco-fsbp.com/cgi-bin/webscripts/nph-home.pl
--2010-01-25 22:25:27--
http://www.tyco-fsbp.com/cgi-bin/webscripts/nph-home.pl
Risoluzione di www.tyco-fsbp.com... 213.203.193.92
Connessione a www.tyco-fsbp.com|213.203.193.92|:80... connesso.
HTTP richiesta inviata, in attesa di risposta...
Lunghezza: non specificato
Salvataggio in: "nph-home.pl"
[ <=>
] 17.810 33,1K/s in 0,5s
2010-01-25 22:25:29 (33,1 KB/s) - "nph-home.pl" salvato [17810]
As you can see, the cineca.it server is printing out several headers
before the actual page.
Your script is just putting out the html page.
From the url it seems it's a Perl script, so let me direct you to the
CGI.pm man page
http://search.cpan.org/dist/CGI.pm/lib/CGI.pm
where you have this example:
#!/usr/local/bin/perl -w
use CGI; # load CGI routines
$q = CGI->new; # create new CGI object
==> print $q->header, # create the HTTP header
$q->start_html('hello world'), # start the HTML
$q->h1('hello world'), # level 1 header
$q->end_html; # end the HTML
Note http headers _before_ the actual html.
HTH
Marcello