![清漆清除显示错误 403 不允许](https://linux22.com/image/691055/%E6%B8%85%E6%BC%86%E6%B8%85%E9%99%A4%E6%98%BE%E7%A4%BA%E9%94%99%E8%AF%AF%20403%20%E4%B8%8D%E5%85%81%E8%AE%B8.png)
在 varnish 配置文件中,我将我的公共地址放在 acl 中。但我仍然无法清除 varnish 缓存。它显示 403 错误。我想远程清除 varnish。我只想从我的 IP 清除 varnish。请帮我设置 acl。
答案1
你可以看看这个教程远程清除清漆缓存
答案2
sub vcl_recv {
if (req.method == "PURGE") {
# If not allowed then a error 405 is returned
if (! req.http.x-forwarded-for || req.http.x-forwarded-for !~ "1.2.3.4") {
return(synth(405, "This forwarded IP is not allowed to send PURGE requests."));
}
return (purge);
}
}