我现在有以下configuration:
# Squid normally listens to port 3128 http_port 3128 cache_peer proxy1_address parent proxy1_port 0 proxy-only default login=name1:pass1 never_direct allow all
现在我需要configurationsquid的方式,当所有传入的请求3128将被redirect到proxy1(因为它现在工作),所有传入的请求3127将被redirect到proxy2。 有可能吗?
我当前的configuration不工作:
http_port 3128 http_port 3127 acl port_3128 port 3128 acl port_3127 port 3127 # 3128 cache_peer proxy01 parent 3128 0 no-query originserver name=proxy3128 cache_peer_access proxy3128 allow port_3128 cache_peer_access proxy3128 deny port_3127 # 3127 cache_peer proxy02 parent 3128 0 no-query originserver name=proxy3127 cache_peer_access proxy3127 allow port_3127 cache_peer_access proxy3127 deny port_3128
这似乎是可能的,但老实说,我还没有尝试过。 您可以组合acl和cache_peer_access来控制哪些stream量被转发到哪个对等体。
acl first_port myport 3128 cache_peer_access proxy1_address allow first_port
你可能需要看看squid的文档页面 。 另外,这里是将其用于多个后端服务器的示例 。
感谢您的帮助,终于find工作configuration(感谢鱿鱼邮件列表的家伙)
http_port 3128 name=port_3128 http_port 3127 name=port_3127 nonhierarchical_direct off acl port_3128_acl myportname port_3128 acl port_3127_acl myportname port_3127 always_direct deny port_3128_acl always_direct deny port_3127_acl never_direct allow port_3128_acl never_direct allow port_3127_acl # 3128 cache_peer proxy1 parent 3128 0 proxy-only default name=proxy3128 cache_peer_access proxy3128 allow port_3128_acl cache_peer_access proxy3128 deny all # 3127 cache_peer proxy2 parent 3128 0 proxy-only default name=proxy3127 cache_peer_access proxy3127 allow port_3127_acl cache_peer_access proxy3127 deny all