该示例将 http://pkg.example.com/myrepo 连接到 internal1.example.com:10000 和 internal2.example.com:10000。
使用相应的 proxy_base 设置配置 depot 服务器,如配置带有前缀的简单代理中所示。
将后端连接的数目限定为每个 depot 服务器运行的线程数目除以负载平衡器设置中的 depot 数目所得的值。如果不这样,Apache 打开的 depot 连接数目会超过可用连接数目,因此连接将被停止,从而降低性能。使用 max= 参数指定到每个 depot 的最大并行连接数目。以下示例中有两个 depot,每个 depot 运行 200 个线程。有关如何设置 depot 线程数目的示例,请参见配置带有前缀的简单代理。
<Proxy balancer://pkg-example-com-myrepo> # depot on internal1 BalancerMember http://internal1.example.com:10000 retry=5 max=100 # depot on internal2 BalancerMember http://internal2.example.com:10000 retry=5 max=100 </Proxy> Redirect /myrepo http://pkg.example.com/myrepo/ ProxyPass /myrepo/ balancer://pkg-example-com-myrepo/ nocanon