You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
647 B
39 lines
647 B
## |
|
## varnish.vcl -- Varnish Configuration Language (VCL) configuration file |
|
## |
|
|
|
backend default { |
|
.host = "127.0.0.1"; |
|
.port = "8081"; |
|
} |
|
|
|
acl purge { |
|
"localhost"; |
|
"127.0.0.1"; |
|
} |
|
|
|
sub vcl_recv { |
|
if (req.request == "PURGE") { |
|
if (!client.ip ~ purge) { |
|
error 405 "Not allowed."; |
|
} |
|
return(lookup); |
|
} |
|
if (req.request == "GET" && req.http.cookie) { |
|
return(lookup); |
|
} |
|
} |
|
|
|
sub vcl_hit { |
|
if (req.request == "PURGE") { |
|
set obj.ttl = 0s; |
|
error 200 "Purged."; |
|
} |
|
} |
|
|
|
sub vcl_miss { |
|
if (req.request == "PURGE") { |
|
error 404 "Not in cache."; |
|
} |
|
} |
|
|
|
|