sub vcl_recv {
set req.backend = default_backend;
if ( req.http.Host == "x.ourdomain.com" ) {
set req.backend = x_backend;
}
if ( req.http.Host == "y.ourdomain.com" ) {
set req.backend = y_backend;
}
}
A menos que você esteja procurando redirecionamentos reais , nesse caso:
sub vcl_recv {
if ( req.http.Host == "x.ourdomain.com" ) {
error 750 "http://10.0.5.1" + req.url;
}
if ( req.http.Host == "y.ourdomain.com" ) {
error 750 "http://10.0.5.5" + req.url;
}
}
sub vcl_error {
if ( obj.status == 750 ) {
set obj.http.Location = obj.response;
set obj.status = "302";
set obj.response = "Found";
return(deliver);
}
}