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" 
<[email protected]<mailto:[email protected]>> 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 
<[email protected]<mailto:[email protected]>> 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, specifically the part that assigns
a backend?
 - P

_______________________________________________
varnish-misc mailing list
[email protected]<mailto:[email protected]>
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

_______________________________________________
varnish-misc mailing list
[email protected]<mailto:[email protected]>
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to