I am using squid as proxy server for blocking patterns in a url (like: block .jpg,.bmp, etc). Now I want to route the whole traffic from my 2nd server (which runs apache) through the proxy server.
So, when a visitor accesses a .jpg file for example, the proxy server blocks the request.
The setup:
- Server #1 runs squid3
- Server #2 runs apache2
How can i configure apache for routing all traffic through a specific proxy?
Best Answer
The configuration you want is a reverse proxy. The main points to configure such a system are:
X-Forwarded-For
header added by squid, as the client IP address will be the one of the squid server. This includes the logs, if you want to look at them on the apache server and not on the squid proxy.