Squid Reverse proxy

We can use squid as a reverse proxy for sharing a public IP with multiple server as well as web acceleration.

Below is the configuration of squid.conf for the purpose of having multiple domains in private IP and that is accessed from the same proxy

# External Port no for squid reverse proxy
http_port 8080 accel vhost

# directive to tell Squid the IP address of the servers are private ip address hosted inside the network
cache_peer parent 80 0 no-query no-digest originserver name=server1
cache_peer parent 80 0 no-query no-digest originserver name=server2
cache_peer parent 80 0 no-query no-digest originserver name=server3

acl sites_server1 dstdomain server1.domain.com
acl sites_server2 dstdomain server2.domain.com
acl sites_server3 dstdomain server3.domain.com

cache_peer_access server1 allow sites_server1
cache_peer_access server2 allow sites_server2
cache_peer_access server3 allow sites_server3

http_access allow sites_server1
http_access allow sites_server2
http_access allow sites_server3

Here 192.168.0.X are internal IPs and serverX.domain.com areĀ  web address that is routed to corresponding internal websites.

Thanks to :



Leave a Reply

Your email address will not be published. Required fields are marked *