configuration-templates – Diff between revs 17 and 18
?pathlinks?
Rev 17 | Rev 18 | |||
---|---|---|---|---|
Line 67... | Line 67... | |||
67 | # which backend to use. |
67 | # which backend to use. |
|
68 | # also used to modify the request |
68 | # also used to modify the request |
|
Line 69... | Line 69... | |||
69 | |
69 | |
|
Line -... | Line 70... | |||
- | 70 | set req.backend_hint = vdir.backend(); # send all traffic to the vdir director |
||
- | 71 | |
||
- | 72 | ### Brotli encoding support. |
||
- | 73 | if(req.http.Accept-Encoding ~ "br" && req.url !~ "\.(jpg|png|gif|gz|mp3|mov|avi|mpg|mp4|swf|wmf)$") { |
||
- | 74 | set req.http.X-brotli = "true"; |
||
70 | set req.backend_hint = vdir.backend(); # send all traffic to the vdir director |
75 | } |
|
71 | |
76 | |
|
72 | # When CloudFlare is in front of varnish, send the real IP address through X-Forwarded-For |
77 | # When CloudFlare is in front of varnish, send the real IP address through X-Forwarded-For |
|
73 | # otherwise if CloudFlare is not involved, set the X-Forwarded-For to the client IP address. |
78 | # otherwise if CloudFlare is not involved, set the X-Forwarded-For to the client IP address. |
|
74 | unset req.http.X-Forwarded-For; |
79 | unset req.http.X-Forwarded-For; |
|
Line 260... | Line 265... | |||
260 | |
265 | |
|
261 | # hash cookies for requests that have them |
266 | # hash cookies for requests that have them |
|
262 | if (req.http.Cookie) { |
267 | if (req.http.Cookie) { |
|
263 | hash_data(req.http.Cookie); |
268 | hash_data(req.http.Cookie); |
|
- | 269 | } |
||
- | 270 | |
||
- | 271 | ### Brotli encoding support. |
||
- | 272 | if(req.http.X-brotli == "true") { |
||
- | 273 | hash_data("brotli"); |
||
264 | } |
274 | } |
|
Line 265... | Line 275... | |||
265 | } |
275 | } |
|
266 | |
276 | |
|
Line 322... | Line 332... | |||
322 | if (beresp.http.Surrogate-Control ~ "ESI/1.0") { |
332 | if (beresp.http.Surrogate-Control ~ "ESI/1.0") { |
|
323 | unset beresp.http.Surrogate-Control; |
333 | unset beresp.http.Surrogate-Control; |
|
324 | set beresp.do_esi = true; |
334 | set beresp.do_esi = true; |
|
325 | set beresp.ttl = 24h; # Set 24h ESI |
335 | set beresp.ttl = 24h; # Set 24h ESI |
|
326 | } |
336 | } |
|
- | 337 | |
||
- | 338 | ### Brotli encoding support. |
||
- | 339 | if(bereq.http.X-brotli == "true") { |
||
- | 340 | set bereq.http.Accept-Encoding = "br"; |
||
- | 341 | unset bereq.http.X-brotli; |
||
- | 342 | } |
||
Line 327... | Line 343... | |||
327 | |
343 | |
|
328 | ### Set content expiration. |
344 | ### Set content expiration. |
|
329 | ## You may want to disable any expiration on the backend (ie: for Apache, disable mod_expires). |
345 | ## You may want to disable any expiration on the backend (ie: for Apache, disable mod_expires). |
|
330 | # 1 Year |
346 | # 1 Year |
|
Line 410... | Line 426... | |||
410 | # Please note that obj.hits behaviour changed in 4.0, now it counts per objecthead, not per object |
426 | # Please note that obj.hits behaviour changed in 4.0, now it counts per objecthead, not per object |
|
411 | # and obj.hits may not be reset in some cases where bans are in use. See bug 1492 for details. |
427 | # and obj.hits may not be reset in some cases where bans are in use. See bug 1492 for details. |
|
412 | # So take hits with a grain of salt |
428 | # So take hits with a grain of salt |
|
413 | set resp.http.X-Cache-Hits = obj.hits; |
429 | set resp.http.X-Cache-Hits = obj.hits; |
|
Line -... | Line 430... | |||
- | 430 | |
||
414 | |
431 | ### |
|
415 | # Remove some headers: PHP version |
432 | ## Remove some headers: PHP version |
|
416 | unset resp.http.X-Powered-By; |
- | ||
417 | |
433 | unset resp.http.X-Powered-By; |
|
418 | # Remove some headers: Apache version & OS |
434 | ## Remove some headers: Apache version & OS |
|
419 | unset resp.http.Server; |
435 | unset resp.http.Server; |
|
420 | unset resp.http.X-Drupal-Cache; |
436 | unset resp.http.X-Drupal-Cache; |
|
421 | unset resp.http.X-Varnish; |
437 | unset resp.http.X-Varnish; |
|
422 | unset resp.http.Via; |
438 | unset resp.http.Via; |
|
423 | unset resp.http.Link; |
439 | unset resp.http.Link; |
|
- | 440 | unset resp.http.X-Generator; |
||
Line 424... | Line 441... | |||
424 | unset resp.http.X-Generator; |
441 | unset resp.http.X-Powered-By; |
|
425 | |
442 | |
|
Line 426... | Line 443... | |||
426 | return (deliver); |
443 | return (deliver); |