I have two squid servers, Squid A and Squid B.
Squid A transparently caches for the local network.
I would like to set up Squid A so that on a request for an URL matching a regexp, instead of serving the request as normal, it "redirects" through Squid B so that Squid B serves the request, passes the result back to Squid A which passes it onto the client.
How do I set up the config file for Squid A to do this?
Best Answer
Use following in squid A configuration (normally /etc/squid/squid.conf)
And following in squid B configuration at top of other acls
After that you can add regular expressions to file /etc/squid/divert.txt and reload squid. The matching URLs will be requested from Server B and not directly.
The reason why I mentioned adding acl on proxy B too is too avoid authentication, connection limit, etc. settings on proxy B affecting clients of proxy A as such problems are very hard to debug. So it is better to allow all requests from proxy A to proxy B. If you want to block something block it in both proxy configurations.