1 // Varnish configuration snippets.
11 if (req.restarts == 0) {
12 if (req.http.x-forwarded-for) {
13 set req.http.X-Forwarded-For =
14 req.http.X-Forwarded-For + ", " + client.ip;
16 set req.http.X-Forwarded-For = client.ip;
19 if (req.http.host ~ "analysis\.sesse\.net$" && req.url ~ "^/analysis\.pl") {
20 set req.backend_hint = analysis;
26 if (resp.http.x-analysis) {
27 set resp.http.Date = now;
28 unset resp.http.X-Varnish;
31 unset resp.http.X-Powered-By;
33 unset resp.http.x-analysis;
37 hash_data(regsub(req.url, "unique=.*$", ""));
39 hash_data(req.http.host);
46 sub vcl_backend_response {
47 if (bereq.http.host ~ "analysis") {
49 if (beresp.http.content-type ~ "text" || beresp.http.content-type ~ "json") {
50 set beresp.do_gzip = true;
52 if (beresp.http.content-type ~ "json") {
53 set beresp.http.x-analysis = 1;
54 ban ( "obj.http.x-analysis == 1 && obj.http.x-rglm != " + beresp.http.x-rglm );