Skip to content

Instantly share code, notes, and snippets.

@wpottier
Last active August 1, 2016 14:11
Show Gist options
  • Save wpottier/4b45e5631c539bbc8b2158a496066f7e to your computer and use it in GitHub Desktop.
Save wpottier/4b45e5631c539bbc8b2158a496066f7e to your computer and use it in GitHub Desktop.
sample.vcl
sub vcl_recv {
if (req.http.host ~ "bebe9\.com") {
set req.http.x-redir = "http://www.bebe9.com" + req.url;
return(synth(850, "Moved permanently"));
}
}
sub vcl_synth {
if (resp.status == 850) {
set resp.http.Location = req.http.x-redir;
set resp.status = 302;
return (deliver);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment