diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-04-17 16:28:41 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-04-17 16:28:41 +0100 |
commit | 5b67028416beb954311ae6b7fd6852939c7dd8dc (patch) | |
tree | 790ffcd77cb4e7055953aa1fa4203988ea0bae22 | |
parent | ad8486ab2f7b73653bb26c92b90b3c3acc02c076 (diff) | |
parent | 660214d34647bf32eef21f0a10baddb62eb1dc0c (diff) |
Merge remote-tracking branch 'openaustralia_github/fix-varnish-cookie-removal' into rails-3-develop
-rw-r--r-- | config/varnish-alaveteli.vcl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/config/varnish-alaveteli.vcl b/config/varnish-alaveteli.vcl index d3726682c..59d76b0d1 100644 --- a/config/varnish-alaveteli.vcl +++ b/config/varnish-alaveteli.vcl @@ -2,10 +2,10 @@ # of Alaveteli. See the vcl(7) man page for details on VCL syntax and # semantics. -# +# # Default backend definition. Set this to point to your content # server. In this case, apache + Passenger running on port 80 -# +# backend default { .host = "127.0.0.1"; @@ -32,7 +32,7 @@ sub vcl_recv { # Sanitise X-Forwarded-For... remove req.http.X-Forwarded-For; set req.http.X-Forwarded-For = client.ip; - + # Remove Google Analytics, has_js, and last-seen cookies set req.http.Cookie = regsuball(req.http.Cookie, "(^|;\s*)(__[a-z]+|has_js|has_seen_country_message|seen_foi2)=[^;]*", ""); @@ -50,14 +50,14 @@ sub vcl_recv { remove req.http.Accept-Encoding; } } - + # Ignore empty cookies if (req.http.Cookie ~ "^\s*$") { remove req.http.Cookie; } - + if (req.request != "GET" && - req.request != "HEAD" && + req.request != "HEAD" && req.request != "POST" && req.request != "PUT" && req.request != "PURGE" && @@ -70,9 +70,9 @@ sub vcl_recv { /* We only deal with GET and HEAD by default, the rest get passed direct to backend */ return (pass); } - + # Ignore Cookies on images... - if (req.url ~ "\.(png|gif|jpg|jpeg|swf|css|js|rdf|ico|txt)(\?.*|)$") { + if (req.url ~ "\.(png|gif|jpg|jpeg|swf|css|js|rdf|ico)(\?.*|)$") { remove req.http.Cookie; return (lookup); } |