Re: [squid-users] Reverse proxy for Primary and then Secondary
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
RE: [squid-users] Reverse proxy for Primary and then Secondary
Hi Indunil Jayasooriya, You maybe turn to the open source high-availability suite (such as heartbeat on http://linux-ha.org/), and set the Secondary web server to take over the Primary's resource (in this case, it is the Primary's IP address ). It is not Squid's job to detect and select which backend server is alive. Just for your reference. Xu Feng Yuanjie Networks,Shanghai,China MSN: [EMAIL PROTECTED] > -Original Message- > From: Indunil Jayasooriya [mailto:[EMAIL PROTECTED] > Sent: 2008年4月10日 14:55 > To: squid-users > Subject: [squid-users] Reverse proxy for Primary and then Secondary > > 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 > > > > > -- > Thank you > Indunil Jayasooriya
Re: [squid-users] Reverse proxy for Primary and then Secondary
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
Re: [squid-users] Reverse proxy for Primary and then Secondary
On 4/10/08, Amos Jeffries <[EMAIL PROTECTED]> wrote: > never_direct allow our_sites > Hi Amos, Why need a "never_direct" here? If squid never_direct, then where will the requests go? Thanks.
Re: [squid-users] Reverse proxy for Primary and then Secondary
> On 4/10/08, Amos Jeffries <[EMAIL PROTECTED]> wrote: > >> never_direct allow our_sites >> > > Hi Amos, > > Why need a "never_direct" here? > If squid never_direct, then where will the requests go? It's needed to make it clear that the requests are to go through the configured peer(s). I find it's a little cleaner, clearer to understand, and prevents squid being at the mercy of DNS for its acceleration links. Amos
Re: [squid-users] Reverse proxy for Primary and then Secondary
On Thu, Apr 10, 2008 at 7:48 PM, Amos Jeffries <[EMAIL PROTECTED]> wrote: > > 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:squid-users > cache_peer_access ip.of.primarywebserver allow our_sites > cache_peer_access ip.of.secondarywebserver allow our_sites > never_direct allow our_sites Hi, amos, Then, Comple rule set will be this. Pls let me know. 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 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. What are they? > > Amos > -- > Please use Squid 2.6.STABLE19 or 3.0.STABLE4 > -- Thank you Indunil Jayasooriya
Re: [squid-users] Reverse proxy for Primary and then Secondary
Indunil Jayasooriya wrote: On Thu, Apr 10, 2008 at 7:48 PM, Amos Jeffries <[EMAIL PROTECTED]> wrote: 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:squid-users cache_peer_access ip.of.primarywebserver allow our_sites cache_peer_access ip.of.secondarywebserver allow our_sites never_direct allow our_sites Hi, amos, Then, Comple rule set will be this. Pls let me know. 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 cache_peer_access ip.of.primarywebserver allow our_sites cache_peer_access ip.of.secondarywebserver allow our_sites never_direct allow our_sites Looks good. If you have multiplewebsites hosted you may need both "accel vhost" options on the http_port. Squid follows that behavior by default. FYI, There are some additional monitor* options to fine-tune recovery. What are they? http://www.squid-cache.org/Versions/v2/2.6/cfgman/cache_peer.html http://www.squid-cache.org/Versions/v3/3.0/cfgman/cache_peer.html Amos -- Please use Squid 2.6.STABLE19 or 3.0.STABLE4