You use the
cache_peer config option to define a peer or parent, and you use
cache_peer_access to force all requests matching a particular squid
acl to use that peer.
cache_peer squid2.example.com sibling 3128 3130
acl alwayspeer dstdomain foo.example.com bar.example.com
cache_peer_access squid2.example.com allow alwayspeer
That will force all requests for those two domains (
bar.example.com) to go via the peer (
alwayspeer is just an arbitrary name I chose for this
If you also want to restrict usage of that peer to ONLY the domains listed in the alwayspeer acl, add the following line:
cache_peer_access squid2.example.com deny !alwayspeer
acl type can be used, not just
dstdom_regex) if you want the acl to regex match part or all of a URL (or domain).
acls can be allowed or denied with
cache_peer_access rules. Note that the order of rules is significant (first matching rule wins).