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
Add "default" to this line, like...
cache_peer ip.of.primarywebserver parent 80 0 no-query originserver default
...and you should be set.
cache_peer ip.of.secondarywebserver parent 80 0 no-query originserver
acl our_sites dstdomain your.main.website
http_access allow our_sites
Chris