Indunil Jayasooriya wrote:
Hi all,
I have 2 web servers . One is Primary and the other is Secondary.
Pls asssume
ip of primary is 1.2.3.4
ip of secondary 2.3.4.5
I want squid resverse proxy to forward traffic to primary server.
When, the primary goes offline, it should forward to Secondary web
Server.
How can I acheive this task?
I am going to keep squid as a reverse proxy in front of them?
pls assume ip of reverse proxy is 5.6.7.8
How Can I write rules in squid.conf?
pls see below rules.
http_port 80 accel defaultsite=your.main.website
cache_peer ip.of.primarywebserver parent 80 0 no-query originserver
cache_peer ip.of.secondarywebserver parent 80 0 no-query originserver
acl our_sites dstdomain your.main.website
http_access allow our_sites
Add:
cache_peer_access ip.of.primarywebserver allow our_sites
cache_peer_access ip.of.secondarywebserver allow our_sites
never_direct allow our_sites
Squid follows that behavior by default.
FYI, There are some additional monitor* options to fine-tune recovery.
Amos
--
Please use Squid 2.6.STABLE19 or 3.0.STABLE4