Drupal 7.x & Varnish 3.x

Mattias Geniar mattias at nucleus.be
Fri Jul 8 09:28:19 CEST 2011


> When I use the code below (based on the templates at
https://github.com/mattiasgeniar/varnish-3.0-configuration-templates/tre
e/master/conf.d), Drupal 7 + Varnish 3 'almost' works.
> 
> Varnish is working perfectly (no backend calls, two Varnish timestamps
in the header). 
> However, I can't log in in my Drupal site. Same behaviour with
directories which are protected by .htaccess. The logon screen keeps
popping up when I enter the correct credentials.

Add the following at the bottom of the vcl receive (it's in the
"default.vcl" file on github):

if (req.http.Authorization || req.http.Cookie) {
          # Not cacheable by default
          return (pass);
}

Without it, you are indeed likely to run into problems.

You may want to check the rest of the content in default.vcl.

Regards,
Mattias




More information about the varnish-misc mailing list