multiple domains -> varnish -> one backend
Jon Drukman
jsd at cluttered.com
Sun May 4 23:27:54 CEST 2008
Jon Drukman wrote:
> Poul-Henning Kamp wrote:
>>> 1.1.2
>> Please update to 1.2 or even better: -trunk, this has been fixed
>> in the meantime.
>
> I am running trunk now and the behavior is the same.
i suspect what is going on is that i am changing req.http.host here:
> sub vcl_recv {
> set req.url = regsub(req.url, "^", "/site");
> set req.http.X-Orig-Host = req.http.host;
> set req.http.host = "originserver.com";
>
> if (req.request == "POST") {
> pipe;
> }
>
> # force lookup even when cookies are present
> if (req.request == "GET" && req.http.cookie) {
> lookup;
> }
> }
and thus varnish is using that as the hash key. this would explain why
the first requested domain is used for all subsequent cached replies. is
there a way to 'save' the original req.http.host and use that as the
hash key? i tried to mess with req.hash in vcl_recv but varnish says
i'm not allowed to tinker with those variables there.
-jsd-
More information about the varnish-misc
mailing list