Re: [squid-users] Reverse proxy for multiple backends based on IP address?

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 23 Sep 2008 01:52:26 +1200

Simon Waters wrote:
> Looking in the achive, before 2.6, it looks like if you want to proxy for
> several servers, then you need to separate the traffic based on the host name
> part of the URL.
>
> I was hoping to separate traffic based on destination IP address, but perhaps
> someone will have a better idea?
>
> i.e.
>
> Proxy (has 2 IP addresses 1.2.3.4 and 1.2.3.5)
>
> 1.2.3.4:80 --> server 1 (2.3.4.5:80)
> 1.2.3.5:80 --> server 2 (2.3.4.6:80)
>
> I have Squid 2.6 currently, and was wondering if this had changed with the
> rewrite that affects reverse proxy config between 2.5 and 2.6.
>
> Currently I have all traffic proxied to 2.3.4.5
> And a list of exceptions:
>
> cache_peer_domain server1 !www.example.com
> cache_peer_domain server2 www.example.com
>
> I have about ~1185 domains to add in this fashion, with more added routinely,
> so some sort of automated procedure is a given. Also I was concerned if a big
> list like this would impact performance.

Don't use cache_peer_domain for a setup like that. cache_peer_access
with a dstdomain ACL becomes very much easier to manage long lists of
domains. Particularly since it can handle a separate file as the list
source. And the wildcard of sub-domains also helps in either use.

Also per your original request, there are several ways of doing it:
  myip ACL - bases it on one of several IPs squid might be listening on.
  myport ACL - bases it on the listening port number
  myportname ACL - ports can now be named (name=X). It's slightly easier
and safer than balancing myip/myport ACLs in multi-mode squid.

Amos

-- 
Please use Squid 2.7.STABLE4 or 3.0.STABLE9
Received on Mon Sep 22 2008 - 13:52:39 MDT

This archive was generated by hypermail 2.2.0 : Mon Sep 22 2008 - 12:00:02 MDT