Commit 2be7f5f42470dece199519fc074d2b6cf9c391b2
Exists in
master
and in
23 other branches
Merge commit 'refs/merge-requests/169' of git://gitorious.org/noosfero/noosfero …
…into merge-requests/169
Showing
2 changed files
with
18 additions
and
5 deletions
Show diff stats
etc/noosfero/varnish-accept-language.vcl
| @@ -182,5 +182,12 @@ sub vcl_recv { | @@ -182,5 +182,12 @@ sub vcl_recv { | ||
| 182 | C{ | 182 | C{ |
| 183 | vcl_rewrite_accept_language(sp); | 183 | vcl_rewrite_accept_language(sp); |
| 184 | }C | 184 | }C |
| 185 | - return(pass); | 185 | +} |
| 186 | + | ||
| 187 | +sub vcl_fetch { | ||
| 188 | + if (beresp.http.Vary) { | ||
| 189 | + set beresp.http.Vary = beresp.http.Vary ", X-Varnish-Accept-Language"; | ||
| 190 | + } else { | ||
| 191 | + set beresp.http.Vary = "X-Varnish-Accept-Language"; | ||
| 192 | + } | ||
| 186 | } | 193 | } |
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 { |