varnish forward to wrong backend
Lei Wang
leiwang at rhapsody.com
Fri Aug 16 01:05:17 CEST 2013
No. That is not the case.
Thanks,
Lei
-------- Original message --------
From: "Crowder, Travis" <Travis.Crowder at penton.com>
Date: 08/15/2013 3:35 PM (GMT-08:00)
To: Lei Wang <leiwang at rhapsody.com>
Cc: James Pearson <james at ifixit.com>,varnish-misc <varnish-misc at varnish-cache.org>
Subject: Re: varnish forward to wrong backend
It is probably that the other domains have the same URL. Check for www.mydns1.com<http://www.mydns1.com> in your first conditional.
-Travis Crowder
Sent from my iPhone
On Aug 15, 2013, at 5:20 PM, "Lei Wang" <leiwang at rhapsody.com<mailto:leiwang at rhapsody.com>> wrote:
Hi James,
It is very simple like below:
sub vcl_recv {
if (req.url ~ "^/my-home") {
set req.http.host = "www.mydns1.com<http://www.mydns1.com>";
set req.backend = backend1 ;
} elsif (req.http.host ~ "^www.mydns2.com<http://www.mydns2.com>") {
set req.http.host = "www.mydns2.com<http://www.mydns2.com>";
set req.backend = backend2
} elsif (req.http.host ~ "^www.mydns3.com<http://www.mydns3.com>") {
unset req.http.Accept;
set req.backend = backend3;
} elsif (req.http.host ~ "^www.mydns4.com<http://www.mydns4.com>") {
unset req.http.Accept;
set req.backend = backend4;
} else {
error 404 "Unknown virtual host";
}
}
Thanks,
Lei
On Thu, Aug 15, 2013 at 2:12 PM, James Pearson <james at ifixit.com<mailto:james at ifixit.com>> wrote:
Excerpts from Lei Wang's message of 2013-08-15 11:09:13 -0700:
> I have varnish 3 (varnish-3.0.4 revision 9f83e8f) installed to cache
> multi-site in one configuration. Sometimes Varnish switched to use the
> first backend in the configuration for all the requests to the other sites.
> As in the sample configuration below, the request to backend2, backend3,
> backend4 sometimes forwarded to backend1. Does anyone have the same problem
> or know any solution, suggestion?
>
> The varnish backend configuration is quite simple like below:
>
> [snip]
What does the rest of your config look like, specifical
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20130815/80dd4aba/attachment-0001.html>
More information about the varnish-misc
mailing list