歡迎您光臨本站 註冊首頁

squid26+pf多站點,多主機反向代理,請看以下這一段這樣寫是否正確?

cache_peer 192.168.1.1 parent 80 0 no-query originserver name=a
cache_peer 192.168.1.2 parent 80 0 no-query originserver name=b
cache_peer 192.168.1.3 parent 80 0 no-query originserver name=c
cache_peer 192.168.1.4 parent 80 0 no-query originserver name=d
cache_peer 192.168.1.5 parent 80 0 no-query originserver name=e
cache_peer 192.168.1.6 parent 80 0 no-query originserver name=f
cache_peer 192.168.1.7 parent 80 0 no-query originserver name=g
cache_peer_domain a .aaa.com
cache_peer_domain b .bbb.com
cache_peer_domain c .ccc.com
cache_peer_domain d .ddd.cn
cache_peer_domain e .eee.com
cache_peer_domain f .fff.cn
cache_peer_domain g .ggg.cn

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

請看以下上面的寫法是否正確?我在運行的時候沒有報錯,但實際情況並不能訪問

cache_peer_domain f .fff.cn 這樣的形式,是否支持.fff.cn的泛解析?
(據某些說法,在squid2.6中可以不使用DNS或/etc/host文件,在此處添加即可,但不確定)

在這一段代碼上面是否還應該指定一些類似於這樣的內容?
acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.1/255.255.255.255
acl to_lan dst 192.168.1.0/24
acl to_localhost dst 127.0.0.0/8
acl Safe_ports port 80 # http
acl Safe_ports port 443 563 # https, snews

http_access allow to_lan
http_access deny to_localhost
http_access deny !Safe_ports
http_access allow all
我指定了,但是報錯。


另外,
http_port 192.168.1.1:80 transparent vhost vport
這樣的格式在啟動時報錯,難道這個寫法是錯誤的?

2006/12/18 09:07:06| Can't be both a transparent proxy and web server accelerator on the same port
FATAL: Bungled squid.conf line 34: http_port 202.202.202.202:80 transparent vhost

[ 本帖最後由 qq830406 於 2006-12-18 09:09 編輯 ]
《解決方案》

我覺得應該這樣
cache_peer 192.168.1.1 parent 80 0 no-query originserver
cache_peer 192.168.1.2 parent 80 0 no-query originserver
cache_peer_domain 192.168.1.1  .aaa.com
cache_peer_domain 192.168.1.2  .bbb.com
《解決方案》

樓上寫的ok啊, 我測試過ok, 最近也在玩squid, 也需要用到 泛域名解析, Me也是學樓上寫的 :wink:

[火星人 ] squid26+pf多站點,多主機反向代理,請看以下這一段這樣寫是否正確?已經有811次圍觀

http://coctec.com/docs/service/show-post-36081.html