1

我的 Varnish VCL 代码需要向后端系统发出一个简单的 GET 请求,并确定请求的资源是否可访问。不幸的是,后端系统总是返回 200,我必须检查响应的实际正文才能做出决定。

有没有办法在 VCL 中访问响应正文(小于 1KB)并对其进行子字符串搜索?

我试图避免仅为此功能实施代理服务。

PS 现在我必须坚持使用 Varnish 2.1(快速)

4

1 回答 1

4

Quick answer: no. Fastly's Varnish has diverged a lot from mainline, so you are basically stuck with what they provide and response body analysis isn't part of it.

Varnish 6.0 and 6.1 internals make that easier to build, but at the moment the vmod (xbody) you need is only available as a commercial product.

于 2018-10-20T20:34:43.607 回答