Skip to content

Commit

Permalink
Backends: included a redirector example for multiple backends
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasgeniar committed Dec 3, 2012
1 parent 16b3df5 commit 560fdc9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions custom.backend.vcl-sample
Expand Up @@ -13,3 +13,33 @@ backend default {
}
.first_byte_timeout = 300s;
}

# Below is an example redirector based on the Client IP (same returning class C subnet IP will get
# rerouted to the same backend, as long as it's available).
#
# In order for these to work, you need to define 2 backends as shown above named 'web1' and 'web2' (replace 'default'
# from the example above).
director pool_clientip client {
{
.backend = web1
.weight = 1;
}
{
.backend = web2
.weight = 1;
}
}

# Below is an example that will round-robin (based on the weight) to each backend.
# Web2 will get twice the hits as web1 since it has double the weight (= preference).
director pool_clientip {
{
.backend = web1
.weight = 1;
}
{
.backend = web2
.weight = 2;
}
}

0 comments on commit 560fdc9

Please sign in to comment.