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;
29 unset resp.http.x-analysis;
33 hash_data(regsub(req.url, "unique=.*$", ""));
35 hash_data(req.http.host);
42 sub vcl_backend_response {
43 if (bereq.http.host ~ "analysis") {
45 if (beresp.http.content-type ~ "text" || beresp.http.content-type ~ "json") {
46 set beresp.do_gzip = true;
48 if (beresp.http.content-type ~ "json") {
49 set beresp.http.x-analysis = 1;
50 ban ( "obj.http.x-analysis == 1 && obj.http.x-remoteglot-last-modified != " + beresp.http.x-remoteglot-last-modified );