Created
December 3, 2015 08:20
-
-
Save ufo22940268/86a894b7a4eed15f89e4 to your computer and use it in GitHub Desktop.
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
vcl 4.0; | |
acl purgers { | |
"localhost"; | |
"127.0.0.1"; | |
"192.168.199.0"/24; | |
} | |
backend default { | |
.host = "localhost"; | |
.port = "3000"; | |
} | |
sub vcl_backend_response { | |
set beresp.http.url = bereq.url; | |
} | |
sub vcl_deliver { | |
if (resp.status != 200) { | |
ban("obj.http.url == " + resp.http.url); | |
} | |
unset resp.http.url; # Optional | |
} | |
sub vcl_recv { | |
if (req.method == "PURGE") { | |
if (!client.ip ~ purgers) { | |
return (synth(405)); | |
} | |
return (purge); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment