Created
April 27, 2010 16:27
-
-
Save darron/380942 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
backend default { | |
.host = "backendsite"; | |
.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 = "backendsite"; | |
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); | |
} | |
if (req.request == "GET" && req.url ~ "^/cmsdirectory/") { | |
error 750 "Moved Temporarily"; | |
} | |
return(lookup); | |
} | |
sub vcl_error { | |
if (obj.status == 750) { | |
set obj.http.Location = "http://backendsite/cmsdirectory/"; | |
set obj.status = 302; | |
return(deliver); | |
} | |
} | |
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