无法从Wordpress清除Varnish缓存

时间:2015-08-11 02:53:57

标签: wordpress request varnish purge

我有' Varnish HTTP Purge'插件安装在Wordpress中。当我更新帖子时,Varnish会拒绝从此插件发送的清除请求,因此仍然会从缓存中读取帖子。如果我运行curl命令,结果如下:

curl -X PURGE "example.com"

Error 405 This IP is not allowed to send PURGE requests.

在我的default.vcl文件中,我有:

acl purge {
"localhost";
"127.0.0.1";
"::1"; 
}

sub vcl_recv {

 if (req.method == "PURGE") {
    if (!client.ip ~ purge) {
    return(synth(405, "This IP is not allowed to send PURGE requests."));
    }

    return (purge);
    } 
...

任何帮助将不胜感激。

0 个答案:

没有答案