Multi sites to one Apache

Tollef Fog Heen tfheen at
Wed Oct 24 10:13:24 CEST 2012

]] list, mailing

> I'm trying to setup varnish on a multi domains to go to one apache server
> then let apache handle everything after caching.
> When I search online People breakout the backend's by domain name.
> I do see to add:
> sub vcl_hash {
>     set req.hash += req.url;
>     if (req.http.Accept-Encoding) {
>         set req.hash += req.http.Accept-Encoding;
>     }
>     #set req.hash += req.http.cookie;
>     return (hash);
> }
> for hashing per site.

This won't hash per site.  It will put the request URL and the
Accept-Encoding into the hash.  This seems like a bad idea, I'd
recommend you rather hash on req.url and (as is done in
the default vcl_hash) and leave Accept-Encoding out of the mix.

Tollef Fog Heen
Technical lead | Varnish Software AS
t: +47 21 98 92 64
We Make Websites Fly!

More information about the varnish-misc mailing list