multiple domains -> varnish -> one backend

Jon Drukman jsd at
Thu May 1 19:27:01 CEST 2008

I am using varnish to accelerate several different incoming domains. 
They all hit the same backend server, but the server responds 
differently depending on the host header (which I passing in as 

Varnish however is ignoring the incoming domain name and just using the 
path as the cache key.  Example:

The backend server responds differently but varnish serves whichever one 
was requested first.  How do I tell varnish that host+path is 
significant instead of just path?

my vcl_recv looks like this:

sub vcl_recv {
     set req.url = regsub(req.url, "^", "/site");
     set req.http.X-Orig-Host =;
     set = "";

     if (req.request == "POST") {

     # force lookup even when cookies are present
     if (req.request == "GET" && req.http.cookie) {


More information about the varnish-misc mailing list