- 论坛徽章:
- 0
|
我也遇到这个问题了
freebsd 6.2 RC2 +squid 2.6.6 做的透明缓存,其他网站都没有问题,就是新浪www.sina.com.cn,news.sina.com.cn 首页打不开,奇怪的是www.sina.com挺好,直接输入具体的网页地址如http://news.sina.com.cn/c/2006-12-31/073010902232s.shtml也能打开。
查cache.log记录如下
1167638034.880 98214 124.156.3.19 TCP_MISS/000 0 GET http://news.sina.com.cn/ - DIRECT/218.30.66.101 -
google了一把有人说是dns问题,但是也不象啊,域名已经解析了。
我怀疑是HTTP协议的问题,禁掉了via和x-forward-for选项。错误如故。
在squid.conf中通过acl,deny掉head中的via后,干脆cache.log中就没有链接news.sina.com.cn的记录。奇怪了,前天还好好的。
在服务器上wget -d news.sina.com.cn能正常抓下首页,记录如下:
---request begin---
GET / HTTP/1.0
User-Agent: Wget/1.10.2
Accept: */*
Host: news.sina.com.cn
Connection: Keep-Alive
---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.0 200 OK
Date: Mon, 01 Jan 2007 13:10:49 GMT
Server: Apache/2.0.58 (Unix)
Last-Modified: Mon, 01 Jan 2007 13:10:28 GMT
ETag: "3e57a6-6c708-565f9900"
Accept-Ranges: bytes
X-Powered-By: mod_xlayout_jh/0.0.1vhs.markII.remix
Cache-Control: max-age=60
Expires: Mon, 01 Jan 2007 13:11:49 GMT
Vary: Accept-Encoding
Content-Type: text/html
Age: 18
X-Cache: HIT from xa-180.sina.com.cn
Connection: close
---response end---
于是分析是新浪首页不允许直接请求IP地址的规则引起的,但是不知道如何看到squid发出的HTTP请求。
然后改掉配置中的host_header选项,将其设为off。还是上不了首页,不过cache.log中的报错变成了502。
如下
1167657099.764 450968 124.156.3.19 TCP_MISS/502 1418 GET http://news.sina.com.cn/ - DIRECT/218.30.66.101 text/html
请各位大虾指点阿!
[ 本帖最后由 moremore2 于 2007-1-1 21:39 编辑 ] |
|