我需要清除或禁止已被不安全请求修改的caching。 我发现一个解决scheme,似乎工作清漆3.0; 但是我在清漆4上。看来这不再是正确的语法。
清除POST或PUT上的清漆
sub vcl_recv { if ( req.request == "POST" || req.request == "PUT" ) { ban("req.url == " + req.url); return(pass); } }
这给我一个错误
Jun 26 17:43:21 test varnishd[2127]: Symbol not found: 'req.request' (expected type BOOL): Jun 26 17:43:21 test varnishd[2127]: ('/etc/varnish/default.vcl' Line 13 Pos 10) Jun 26 17:43:21 test varnishd[2127]: if ( req.request == "POST" || req.request == "PUT" ) { Jun 26 17:43:21 test varnishd[2127]: ---------###########-------------------------------------- Jun 26 17:43:21 test varnishd[2127]: Running VCC-compiler failed, exited with 2
我能做些什么来使清漆清除/禁止不安全的要求?
谢谢。
在光油4中,req.request变成了req.method。 https://www.varnish-cache.org/docs/4.0/whats-new/upgrading.html