Search squid archive

Re: Reverse proxy for multiple backends based on IP address?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux