Skip to content

Instantly share code, notes, and snippets.

@Hakon
Created September 6, 2015 18:44
Show Gist options
  • Save Hakon/54509e2681987250b72c to your computer and use it in GitHub Desktop.
Save Hakon/54509e2681987250b72c to your computer and use it in GitHub Desktop.
backend backend_1 {
.host = "server1";
.port = "80";
}
backend backend_2 {
.host = "server2";
.port = "80";
}
# set backend default
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# I vcl_recv:
if (req.http.host == "www.foo.no" || req.http.host == "foo.no") {
set req.backend = backend_1;
} else if (req.http.host == "www.bar.no" || req.http.host == "bar.no") {
set req.backend = backend_2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment