very_99 发表于 2009-03-12 22:08:35

用squid就不能访问,不用就能访问。【已经解决】

http://www.ntds.gov.cn:7000
这是一个税务的东西。我发现通过squid死活无法访问啊。
1.在squid服务器上可以telnet这个端口
2.使用代理访问时候出现web提示
please esure property "proxyServer" in server.property was not empty!
此时squid日志为

10.64.1.1 - - "GET http://218.91.250.43:7000/ HTTP/
1.0" 200 393 TCP_MISS:DIRECT
防火墙上日志为
2009-03-12 22:02:14 10.64.1.30:38141 218.91.250.43:7000 xxxxx:7276 218.91.250.43:7000 VDO LIVE (TCP) 37 sec. 1464 1124 Close - TCP FIN
看到
Bytes Sent 为 1464
Bytes Received 为 1124

3.squid.conf
http_port 8080
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache_mem 64 MB
cache_swap_low 70
cache_swap_high 85
maximum_object_size 20480 KB
ipcache_size 10240
ipcache_low 90
ipcache_high 95
fqdncache_size 10240
cache_dir ufs /var/spool/squid 15000 16 256
emulate_httpd_log on
redirect_rewrites_host_header off
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     4320
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl localhost src 10.64.16.0/255.255.240.0
acl localhost src 10.64.128.0/255.255.240.0
acl localhost src 10.64.32.0/255.255.224.0
acl localhost src 10.64.144.0/255.255.240.0
acl SSL_ports port 443 563
acl CONNECT method CONNECT
acl Safe_ports port 1-65535
no_cache deny QUERY
http_access allow all
http_access allow manager localhost
http_access allow localhost
http_access deny manager
http_access deny !Safe_ports
http_access allow Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
http_reply_access allow all
icp_access allow all
cache_mgr admin
cache_effective_user squid
cache_effective_group squid
forwarded_for off
log_icp_queries off
buffered_logs on
coredump_dir /var/spool/squid

[ 本帖最后由 very_99 于 2009-3-20 15:26 编辑 ]

very_99 发表于 2009-03-13 11:02:11

测试中

在squid服务器上 用wget -d 直接连接测试,好像没问题啊
# wget -d http://218.91.250.43:7000/
DEBUG output created by Wget 1.10.1 (Red Hat modified) on linux-gnu.

--10:45:45--  http://218.91.250.43:7000/
           => `index.html'
Connecting to 218.91.250.43:7000... connected.
Created socket 3.
Releasing 0x09045b98 (new refcount 0).
Deleting unused 0x09045b98.

---request begin---
GET / HTTP/1.0
User-Agent: Wget/1.10.1 (Red Hat modified)
Accept: */*
Host: 218.91.250.43:7000
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.1 200 OK
Date: Fri, 13 Mar 2009 02:59:35 GMT
Pragma: no-cache
Content-Length: 1884
Content-Type: text/html; charset=GBK
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Connection: Keep-Alive
Set-Cookie: JSESSIONID=J5MXclfrgPr6wjDh7JGHNpx1LrjncgFT46lnc8HyBWtsKCmHm090!2095
680327; path=/
P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"
Cache-Control: no-store

---response end---
200 OK
Registered socket 3 for persistent reuse.

Stored cookie 218.91.250.43 7000 / <session> <insecure> JSESSIONID
J5MXclfrgPr6wjDh7JGHNpx1LrjncgFT46lnc8HyBWtsKCmHm090!2095680327
Length: 1,884 (1.8K)

100%[====================================>] 1,884       1015.40B/s

10:45:47 (1015.09 B/s) - `index.html' saved






在squid上  用wet -d -e http://127.0.0.1:8080  http://XXXXX.7000 测试
# wget -d -e "http_proxy=http://127.0.0.1:8080" http://218.91.250.
43:7000
Setting http_proxy (httpproxy) to http://127.0.0.1:8080
DEBUG output created by Wget 1.10.1 (Red Hat modified) on linux-gnu.

--15:25:13--  http://218.91.250.43:7000/
           => `index.html.6'
Connecting to 127.0.0.1:8080... connected.
Created socket 3.
Releasing 0x09e0ec40 (new refcount 0).
Deleting unused 0x09e0ec40.

---request begin---
GET http://218.91.250.43:7000/ HTTP/1.0
User-Agent: Wget/1.10.1 (Red Hat modified)
Accept: */*
Host: 218.91.250.43:7000

---request end---
Proxy request sent, awaiting response...
---response begin---
HTTP/1.0 200 OK
Date: Fri, 13 Mar 2009 07:39:06 GMT
Content-Length: 154
Content-Type: text/html; charset=GBK
Set-Cookie: JSESSIONID=J6Nh11yS2BBkm0LD1ryMgg1204nWjcFxf6RgKwycKTNfnp2nMFC9!2095
680327; path=/
P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"
X-Cache: MISS from xxx.xxx.com
Proxy-Connection: close

---response end---
200 OK

Stored cookie 218.91.250.43 7000 / <session> <insecure> JSESSIONID
J6Nh11yS2BBkm0LD1ryMgg1204nWjcFxf6RgKwycKTNfnp2nMFC9!2095680327
Length: 154

100%[====================================>] 154           --.--K/s

Closed fd 3
15:25:13 (20.98 MB/s) - `index.html.6' saved



在这里发现了 获得的文件大小不一样了

[ 本帖最后由 very_99 于 2009-3-13 15:43 编辑 ]

very_99 发表于 2009-03-13 14:41:42

问题补充

是否与squid缓存动态网页的相关联?
是否在我原先配置中对这个网页做了缓存?

尝试了一下
##########--090312--begin#########
acl ntds url_regex -i ^http://www\.ntds\.gov\.cn/*
no_cache allow ntds

acl ntdsip url_regex  7000
no_cache allow ntdsip
##########--090312--end#########

不行啊

[ 本帖最后由 very_99 于 2009-3-13 15:12 编辑 ]

very_99 发表于 2009-03-19 13:39:17

补充分析

对方可能使用tomcat做处理的,tomcat中会有社么参数导致这样的问题呢?

爱恨交错 发表于 2009-03-19 16:37:11

:em18: :em18: :em18: :em18: :em18: :em18:

sinboy2002 发表于 2009-03-19 16:58:13

估计是该网站做了某些设置!
比如会检测HTTP请求报头,如果设置了代理,就返回xxx。。。

我测试了下,在squid.conf中加上下面2句,通过squid也可以访问lz所说的网站了:)

via off
reply_header_access X-Cache deny all

very_99 发表于 2009-03-20 11:05:07

yy

[ 本帖最后由 very_99 于 2009-3-20 11:15 编辑 ]

very_99 发表于 2009-03-20 11:06:05

原帖由 sinboy2002 于 2009-3-19 16:58 发表 http://bbs2.chinaunix.net/images/common/back.gif
估计是该网站做了某些设置!
比如会检测HTTP请求报头,如果设置了代理,就返回xxx。。。

我测试了下,在squid.conf中加上下面2句,通过squid也可以访问lz所说的网站了:)



感谢回复啊。   我没这个参数啊

[ 本帖最后由 very_99 于 2009-3-20 11:07 编辑 ]

very_99 发表于 2009-03-20 12:52:28

原帖由 sinboy2002 于 2009-3-19 16:58 发表 http://bbs2.chinaunix.net/images/common/back.gif
估计是该网站做了某些设置!
比如会检测HTTP请求报头,如果设置了代理,就返回xxx。。。

我测试了下,在squid.conf中加上下面2句,通过squid也可以访问lz所说的网站了:)



谢谢这位的提示。  我发现由于我版本低,所以没这个参数。
但是这也提醒我,可能需要禁止head,
那么我做了如下操作

header_access Via deny all
header_access X-Forwarded-For deny all

默认都是allow。

之后就可以了。

啊, 发现详细的地方,还有很多不懂啊 。。。。

等下开贴 继续咨询header的问题。
页: [1]
查看完整版本: 用squid就不能访问,不用就能访问。【已经解决】