varnish cache configuration for multiple domain

Nuno Fernandes npf-mlists at eurotux.com
Mon Jan 24 17:15:16 CET 2011


Your request has a cookie so it gets pickup by the code:

    if (req.http.Authorization || req.http.Cookie) {
#        /* Not cacheable by default */
        return (pass);               <<<<-------- It returns here without 
setting the backend
   }

if (req.http.host == "site3.tieto.com") {

        #You will need the following line only if your backend has multiple 
virtual host names
        set req.http.host = "site3.tieto.com";
	set req.http.X-Orig-Host = req.http.host;
        set req.backend = site3;
        return (lookup);
}

if (req.http.host == "sitetwo.tieto.com") {

        #You will need the following line only if your backend has multiple 
virtual host names
        set req.http.host = "sitetwo.tieto.com";
	set req.http.X-Orig-Host = req.http.host;
        set req.backend = site2;
        return (lookup);
}

Plz check the configuration i've sent you privatly...

Best regards,
Nuno Fernandes

On Monday 24 January 2011, Hari Metkari wrote:
> Hi All,
> 
> I am implementing varnish cache for multiple separate domain.i.e
> sitetwo.tieto.com and site3.tieto.com
> 
> I am configured varnish cache on varnish server local ip address
> (192.168.126.30) and my sitetwo.tieto.com ip address 192.168.126.60 and
> site3.tieto.com ip address 192.168.126.20 as per snap
> varnush-cache-server-setup.bmp.Here I make varnish cache server act as a
> central server and cache content.
> 
> when I am add only single backend for single domain in VCL file that time
> it's working fine with varnish logs.see in snap site3.bmp but when I added
> multiple backend for multiple domain in vcl file that time i hit
> sitetwo.tieto.com and check varnish logs see snap sitetwo.bmp(here I hit
> sitetwo.tieto.com it calls to backend of site3 instead of backend site2 in
> varnish logs,here I am expected backend open site2,here is main my
> problem).
> 
> Please find attached varnish configuration files and snap of varnish logs.
> 
> Please look this issue and please help me where i am wrong in varnish cache
> configuration.
> 
> Thanks in Advanced [?]
> 
> 
> Thanks,
> Hari Metkari
> Software Engineer.
> +91-9881462183




More information about the varnish-misc mailing list