Hi Antonio,
You could use [HTTP::path] or maybe it would be more ideal to parse the domain of the host instead so that all requests for example.com go to the same proxy. You could also handle IP addresses in the host header and requests without a host header value:
Check if Host header is present and not an IP address
if {[string match -nocase {*[a-z]*} [HTTP::host]]}{
Persist on the last two fields of the domain
https://devcentral.f5.com/wiki/iRules.domain.ashx
persist hash [domain [HTTP::host] 2]
} elseif {[HTTP::host] ne ""}{
Host header value is an IP
persist hash [HTTP::host]
} else {
Host header value is blank so persist on the path
persist hash [HTTP::path]
}
Aaron