Category Archives: Squid

Squid Multiple Outgoing IP

I got lots of queries from Fellow VPS server Administrators on using all of IPs provided by provider for browsing the internet and rotating the IP addresses for squid multiple outgoing ip

When squid server is configured by using following squid acls and tcp_outgoing_address directives we can use all of IPs that are assigned.Here is configuration of  squid multiple outgoing IP address using tcp_outgoing_address

acl myip1 myip
acl myip2 myip
acl myip3 myip

tcp_outgoing_address myip1
tcp_outgoing_address myip2
tcp_outgoing_address myip3

Here I take - as your assigned IP

The acl lines tell squid to match myip which means if someone uses the IP as their proxy server they will match the acl ip1 and so on..

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
acl sites_server2 dstdomain
acl sites_server3 dstdomain

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 are  web address that is routed to corresponding internal websites.

Thanks to :