From 053d44d71aecc4b0802d13a54a132b2c676d5376 Mon Sep 17 00:00:00 2001 From: whirigoyen Date: Tue, 21 Dec 2021 09:26:41 +0100 Subject: [PATCH] Ajout exemple sans regex --- HowtoVarnish.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/HowtoVarnish.md b/HowtoVarnish.md index 1832ab3f..85733199 100644 --- a/HowtoVarnish.md +++ b/HowtoVarnish.md @@ -139,11 +139,15 @@ Voyons un exemple simple : ~~~ sub vcl_recv { - - if (req.http.host ~ "(www\.example\.com|example\.com)") { + if (req.http.host == "example.com" || + req.http.host == "www.example.com") { set req.backend_hint = default; } - + # Version avec une regex (plus coûteux) : + #if (req.http.host ~ "(example\.com|www\.example\.com)") { + # set req.backend_hint = default; + #} + if (req.url ~ "^/images") { unset req.http.cookie; }