bon*_*ter 5 proxy squid transparent-proxy
我现在有以下配置:
# 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
Run Code Online (Sandbox Code Playgroud)
现在,我需要以某种方式配置鱿鱼,将所有到 3128 的传入请求都重定向到 proxy1(就像现在一样),并且所有到 3127 的传入请求都将重定向到 proxy2。可以做吗?
我当前的配置不起作用:
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
Run Code Online (Sandbox Code Playgroud)
感谢您的帮助,终于找到了工作配置(感谢鱿鱼邮件列表中的家伙)
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
Run Code Online (Sandbox Code Playgroud)
似乎是可以的,但说实话我以前没有尝试过。您可以组合acl和cache_peer_access来控制将哪些流量转发到哪个对等点。
acl first_port myport 3128
cache_peer_access proxy1_address allow first_port
Run Code Online (Sandbox Code Playgroud)
您可能需要查看鱿鱼文档页面。另外,这里是一个将其用于多个后端服务器的示例。
| 归档时间: |
|
| 查看次数: |
9218 次 |
| 最近记录: |