<div dir="ltr"><div><div><div>Hi James,<br><br></div>It is very simple like below:<br>sub vcl_recv {<br>  if (req.url ~ "^/my-home") {<br>    set req.http.host = "<a href="http://www.mydns1.com">www.mydns1.com</a>";<br>
    set req.backend = backend1 ;<br>  } elsif (req.http.host ~ "^<a href="http://www.mydns2.com">www.mydns2.com</a>") {<br>    set req.http.host = "<a href="http://www.mydns2.com">www.mydns2.com</a>";<br>
    set req.backend = backend2<br>  } elsif (req.http.host ~ "^<a href="http://www.mydns3.com">www.mydns3.com</a>") {<br>    unset req.http.Accept;<br>    set req.backend = backend3;<br>  } elsif (req.http.host ~ "^<a href="http://www.mydns4.com">www.mydns4.com</a>") {<br>
    unset req.http.Accept;<br>    set req.backend = backend4;<br>  } else {<br>    error 404 "Unknown virtual host";<br>  }<br>}<br><br><br></div>Thanks,<br><br></div>Lei<br></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Thu, Aug 15, 2013 at 2:12 PM, James Pearson <span dir="ltr"><<a href="mailto:james@ifixit.com" target="_blank">james@ifixit.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Excerpts from Lei Wang's message of 2013-08-15 11:09:13 -0700:<br>
<div class="im">> I have varnish 3 (varnish-3.0.4 revision 9f83e8f) installed to cache<br>
> multi-site in one configuration. Sometimes Varnish switched to use the<br>
> first backend in the configuration for all the requests to the other sites.<br>
> As in the sample configuration below, the request to backend2, backend3,<br>
> backend4 sometimes forwarded to backend1. Does anyone have the same problem<br>
> or know any solution, suggestion?<br>
><br>
> The varnish backend configuration is quite simple like below:<br>
><br>
</div>> [snip]<br>
<br>
What does the rest of your config look like, specifically the part that assigns<br>
a backend?<br>
 - P<br>
<br>
_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
</blockquote></div><br></div>