if (server.region ~ "(^EU-|^AF-|^South-Africa$)" && backend.F_origin_0.healthy) {
set req.backend = F_origin_0;
log "Selecting European origin as geographically closest";
} else if (server.region ~ "(^Asia-|^Asia$|^APAC$)" && backend.F_origin_1.healthy) {
set req.backend = F_origin_1;
log "Selecting Asian origin as geographically closest";
} else if (backend.F_origin_2.healthy) {
set req.backend = F_origin_2;
log "Selecting American origin as geographically closest";
} else {
set req.backend = F_origin_0;
log "Selecting European origin as fallback";
}