I am trying to get logic for a domain replacement. When external users access *.api.domain.com F5 need to replace the domain with *.mydomain.com and send the request to the pool members.
.mydomain.com is not advertised externally,so i need F5 to do the domain replacement so the backend servers can process the traffic.
and when backend server sends the response F5 need to again replace the request with f5.api.domain.com as client should not see the anywhere the internal domain in the header.
when HTTP_REQUEST {
set external_hostname “*.api.domain.com”
set internal_hostname “*.mydomain.com”
HTTP::header replace “Host” $internal_hostname
}
when HTTP_RESPONSE {
if { [HTTP::header value “Location”] ends_with “$internal_hostname” }{