Created
March 3, 2012 05:21
-
-
Save gclitheroe/1964540 to your computer and use it in GitHub Desktop.
Varnish BAN config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (req.request == "DELETE") { | |
if (!client.ip ~ purge) { | |
error 405 "Not allowed."; | |
} | |
if (req.http.X-BanExpression) { | |
ban(req.http.X-BanExpression); | |
} | |
else { | |
ban_url(req.url); | |
} | |
# Throw a synthetic page so the | |
# request won't go to the backend. | |
error 200 "Ban added"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment