Skip to content

Instantly share code, notes, and snippets.

@cheald
Created November 3, 2012 00:32
Show Gist options
  • Save cheald/4005245 to your computer and use it in GitHub Desktop.
Save cheald/4005245 to your computer and use it in GitHub Desktop.
acl purge {
"localhost";
"192.168.100.0"/24;
}
if ( req.request == "PURGE" ) {
if (!client.ip ~ purge) {
error 405 "Not allowed";
}
if ( req.http.x-purge ) {
purge("req.url ~ " req.http.x-purge " && req.http.host == " req.http.host);
} else {
purge("req.url == " req.url " && req.http.host == " req.http.host);
}
error 200 "Purged";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment