I have a seemingly simple problem:
I need to exclude only the homepage from Varnish by modifying default.vcl.
I have tried the following syntax:
if (req.url == "http://www.test.com/") {
return (pass);
}
-- with all the variations (trailing slashes etc.).
I feel like I am missing something simple/fundamental here... can anyone give me a hand?
req.url
holds the URL as per the http standards. This in your case is /
. req.http.host
is where the host is sent. It corresponds to the basic anatomy of a HTTP request. So your example would be written:
if (req.http.host == "www.test.com" && req.url == "/") {
return (pass);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With