Commit 891bd6bd69d5ed99d175443fe52bee18a10b00b2

Authored by Antonio Terceiro
1 parent b15c4edd

Ignore all cookies except the Noosfero one

If people use things like Google Analytics and other Javascript crap
that sets cookies and we don't ignore then on the Varnish side, then no
cache is done at all.
Showing 1 changed file with 10 additions and 4 deletions   Show diff stats
etc/noosfero/varnish-noosfero.vcl
1 -  
2 -backend default {  
3 - .host = "127.0.0.1";  
4 - .port = "8080"; 1 +sub vcl_recv {
  2 + if (req.http.Cookie) {
  3 + # We only care about the "_noosfero_session.*" cookie, used for
  4 + # authentication.
  5 + if (req.http.Cookie ~ "_noosfero_session.*" ) {
  6 + return (pass);
  7 + }
  8 + # Else strip all cookies
  9 + unset req.http.Cookie;
  10 + }
5 } 11 }
6 12
7 sub vcl_error { 13 sub vcl_error {