Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个看似简单的问题:
我只需要通过修改 default.vcl 从 Varnish 中排除主页。
我尝试了以下语法:
if (req.url == "http://www.test.com/") { return (pass); }
- 所有的变化(斜线等)。
我觉得我在这里遗漏了一些简单/基本的东西......谁能帮帮我?
req.url按照 http 标准保存 URL。在你的情况下是/. req.http.host是主机发送的地方。它对应于 HTTP 请求的基本结构。所以你的例子会写成:
req.url
/
req.http.host
if (req.http.host == "www.test.com" && req.url == "/") { return (pass); }