Based on what I understand, you need to replace the "Location" response header.
In this case please try following irule without the need to add any "Stream" Profile.
when HTTP_RESPONSE {
if { [HTTP::is_redirect] } {
if { [HTTP::header Location] contains "/server1" } {
log local0. "Location value before replace : [HTTP::header value Location]"
HTTP::header replace Location [ string map -nocase { "/server1" "" } [HTTP::header value Location] ]
log local0. "Location value after replace : [HTTP::header value Location]"
}
}
}
You can check the /var/log/ltm to check if it is working well.
Also replace "/server1" by the name of your backend server.
Regards