Available inall subroutines.

Looks up the key key in the table id. When the key is present, its associated value will be returned. When the key is absent, the default value is returned. The default value is required.

Just as for the req.backend variable, both backend names and director names may be specified.


backend b0 { .host = ""; }
backend b1 { .host = ""; }
backend b2 { .host = ""; }
director d0 random {
{ .backend = b0; .weight = 1; }
{ .backend = b2; .weight = 1; }
table t BACKEND {
"": b0,
"": b1,
"": d0,
sub vcl_recv {
set req.backend = table.lookup_backend(t,, req.backend);

User contributed notes


Do you see an error in this page? Do have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact