Created
January 27, 2011 18:30
-
-
Save ismasan/798947 to your computer and use it in GitHub Desktop.
Varnish VCL example for purging wildcard URLs
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
# This goes in vcl_recv | |
# It gives you: | |
# curl -X PURGE http://some.example.com/.* | |
# curl -X PURGE http://some.example.com/blog/.* | |
# curl -X PURGE http://some.example.com/blog/2011/bar.html | |
# curl -X PURGE http://another.example.com/.* | |
# | |
if (req.request == "PURGE") { | |
# Wildcard, per-domain purging | |
purge("req.http.host == " req.http.host " && req.url ~ " req.url "$"); | |
error 200 "Purged."; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment