歡迎您光臨本站 註冊首頁

squid 3.0反向代理

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

squid 3.0反向代理

CentOS 5.2  squid 3.0

http_access allow all
http_port 80 accel vhost vport

cache_peer 192.168.100.218 parent 80 0 no-query originserver name=web   (web伺服器)
cache_peer 192.168.100.9   parent 8083 0 no-query originserver name=img (圖片伺服器)

cache_peer_domain web aaa.com
cache_peer_domain img bbb.com

cache_peer_access web allow all
cache_peer_access img allow all


現在通過aaa.com域名訪問網站 沒問題,可以訪問

問題是 我下面有很多域名(上萬) 比如11.com  22.com  33.com....

如果我要使用這些域名通過代理都能訪問到 web

那是不是我要添加如下上萬條這樣的語句呢?

cache_peer_domain web 11.com
cache_peer_domain web 22.com
cache_peer_domain web 33.com
.....
是否還有什麼別的方法 希望能得到大家的幫助,小弟先謝謝了!
《解決方案》

每天UP下.......
《解決方案》

加一個目的地址為*的acl,名叫allweb
cache_peer_domain web allweb

因為默認名為all的acl定義為acl all src all,只是指定源地址是任何地址
一般我不用cache_peer_domain ,這個都可以用cache_peer_access 配合acl來達到功能
你上www.squid-cache.org查下吧

[火星人 ] squid 3.0反向代理已經有494次圍觀

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