diff --git a/custom.backend.vcl-sample b/custom.backend.vcl-sample index 5e1df9d..3e0a2f7 100644 --- a/custom.backend.vcl-sample +++ b/custom.backend.vcl-sample @@ -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; + } +} +