Forum Discussion
Kevin_Stewart
Sep 03, 2013Employee
Is this an APM access portal, or just LTM-based? If the latter, you'll probably want to use a data group to map the URI pattern to a given internal host name. Example:
Data group (ex. my_uri_dg):
"/application1" := "server1.domain.com"
"/application2" := "server2.domain.com"
"/application3" := "server3.domain.com"
And then an iRule like this:
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] starts_with my_uri_dg] } {
HTTP::header replace Host [class match -value [string tolower [HTTP::uri]] starts_with my_uri_dg]
}
}
Alternatively, if it's a small static set of hosts you can hard-code it into the iRule, or if it's a large set of dynamically changing hosts, you could potentially perform a reverse DNS query from the load balanced server IP to get the server's name.