Ipstenu / varnish-http-purge

Proxy Cache Purge
Apache License 2.0
46 stars 48 forks source link

Add Varnish 4 rules to documentation #6

Closed Ipstenu closed 8 years ago

Ipstenu commented 10 years ago

From https://wordpress.org/support/topic/varnish-4?replies=3

Tested it now with Varnish 4.0.1 and got it working with this in the default.vcl:

acl invalidators {
"127.0.0.1"
"localhost";
"<servers_hostname>";
"<servers_ip>";
}
sub vcl_recv {
if (req.method == "PURGE") {
if (!client.ip ~ invalidators) {
return (synth(405, "Not allowed"));
}
return (purge);
}
}

EDIT: I couldn't get this to work before i added my servers public IP in the authorized client list. Edited the post to fit the results in case it might help someone else.