Thursday, December 14, 2006

Squid : 解救 Invalid Response 的網頁 - relaxed_header_parser on

之前我文章有提過 上 http://sii.tse.com.tw 會出現下面的錯誤訊息

ERROR
The requested URL could not be retrieved

--------------------------------------------------------------------------------

While trying to process the request:

GET / HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-icq, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: zh-TW
Proxy-Connection: Keep-Alive
If-Modified-Since: Wed, 29 Nov 2006 01:05:45 GMT; length=14906
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; IEMB3)
Host: sii.tse.com.tw
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAGQAAAAYABgAfAAAAAQABABIAAAACgAKAEwAAAAOAA4AVgAAAAAAAACUAAAABYKIIgUBKAoAAAAPVABDAHAANAAzADIAMwAzAFEASgBaAEwAMQBTALjPNZk2jsKNAAAAAAAAAAAAAAAAAAAAAFpLr1fvdFTabDl01lYpPRXBMGBKt0ILqX==

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 root.


現在我終於查出原因了 是某些網頁的 Header 的問題
在 squid.conf 請不要不要將 relaxed_header_parser 設成 off
請用 relaxed_header_parser on

中山大學圖書館電子資料庫 ezproxy 如果用 squid 也會遇到同樣的問題
http://www.lib.nsysu.edu.tw/database/search/DatabasesList.asp?Language=%A6%E8%A4%E5

以下為 squid.conf - relaxed_header_parser 的說明
# TAG: relaxed_header_parser on|off|warn
# In the default "on" setting Squid accepts certain forms
# of non-compliant HTTP messages where it is unambiguous
# what the sending application intended even if the message
# is not correctly formatted. The messages is then normalized
# to the correct form when forwarded by Squid.
#
# If set to "warn" then a warning will be emitted in cache.log
# each time such HTTP error is encountered.
#
# If set to "off" then such HTTP errors will cause the request
# or response to be rejected.
#

No comments:

Post a Comment