Making decisions based on HTTP headers
Changing the backend based on the header
sub vcl_recv{
# Default backend
set req.backend_hint = c82_tcdnes.backend();
# Changing backend for Spanish users
if (req.http.geo_country_code ~ "ES") {
set req.backend_hint = c82_tcdnes.backend();
}
# Changing backend for American users
if (req.http.geo_country_code ~ "US") {
set req.backend_hint = c82_tcdnus.backend();
}
}Allowing traffic only to users with a specific header
Last updated
Was this helpful?
