我有一个基本的鱿鱼configuration,直接连接到互联网,我需要一种方法来使用父对等取决于URL。
举个例子:
这是一个简单的例子,可以通过DNS解决,但我做的更复杂一点。
我尝试了Google的search结果,但大多数结果是无关紧要的。 谢谢。
从鱿鱼常见问题 。
cache_peer_domain指令允许你为某些域指定特定的caching兄弟或父项:
# squid.conf - On the host: sv.cache.nlanr.net # # Format is: hostname type http_port udp_port # cache_peer electraglide.geog.unsw.edu.au parent 3128 3130 cache_peer cache1.nzgate.net.nz parent 3128 3130 cache_peer pb.cache.nlanr.net parent 3128 3130 cache_peer it.cache.nlanr.net parent 3128 3130 cache_peer sd.cache.nlanr.net parent 3128 3130 cache_peer uc.cache.nlanr.net sibling 3128 3130 cache_peer bo.cache.nlanr.net sibling 3128 3130 cache_peer_domain electraglide.geog.unsw.edu.au .au cache_peer_domain cache1.nzgate.net.nz .au .aq .fj .nz cache_peer_domain pb.cache.nlanr.net .uk .de .fr .no .se .it cache_peer_domain it.cache.nlanr.net .uk .de .fr .no .se .it cache_peer_domain sd.cache.nlanr.net .mx .za .mu .zm
上面的configuration表明,caching将使用pb.cache.nlanr.net和it.cache.nlanr.net作为域名uk,de,fr,no,se和it,sd.cache.nlanr.net作为域名mx,za ,mu和zm,而cache1.nzgate.net.nz域au,aq,fj和nz。
来自示例squidconfiguration文件的关于cache_peer_domain的评论。
# TAG: cache_peer_domain # Use to limit the domains for which a neighbor cache will be # queried. Usage: # # cache_peer_domain cache-host domain [domain ...] # cache_peer_domain cache-host !domain # # For example, specifying # # cache_peer_domain parent.foo.net .edu # # has the effect such that UDP query packets are sent to # 'bigserver' only when the requested object exists on a # server in the .edu domain. Prefixing the domain name # with '!' means the cache will be queried for objects # NOT in that domain. # # NOTE: * Any number of domains may be given for a cache-host, # either on the same or separate lines. # * When multiple domains are given for a particular # cache-host, the first matched domain is applied. # * Cache hosts with no domain restrictions are queried # for all requests. # * There are no defaults. # * There is also a 'cache_peer_access' tag in the ACL # section. # #Default: # none