Skip to content

Instantly share code, notes, and snippets.

@darron
Created April 27, 2010 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darron/380966 to your computer and use it in GitHub Desktop.
Save darron/380966 to your computer and use it in GitHub Desktop.
backend default {
.host = "backendhost";
.port = "80";
.probe = {
.url = "/probe.html";
.timeout = 10 s;
.interval = 30 s;
.window = 10;
.threshold = 8;
.initial = 10;
}
}
sub vcl_recv {
set req.http.Host = "backendhost";
if (req.backend.healthy) {
set req.grace = 30s;
} else {
set req.grace = 1h;
}
if (req.request != "GET" &&
req.request != "HEAD" &&
req.request != "PUT" &&
req.request != "POST" &&
req.request != "TRACE" &&
req.request != "OPTIONS" &&
req.request != "DELETE") {
/* Non-RFC2616 or CONNECT which is weird. */
return (pipe);
}
if (req.request != "GET" && req.request != "HEAD") {
/* We only deal with GET and HEAD by default */
return (pass);
}
return(lookup);
}
sub vcl_fetch {
if (beresp.ttl < 300s) {
set beresp.ttl = 300s;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment