If you want to rewrite the redirects from the virtual server IP to a hostname and from http:// to https://, you can modify the string map command:
when HTTP_RESPONSE {
Check if response is a 30x redirect
if { [HTTP::header is_redirect]} {
Rewrite http:// to https:// and the IP to the hostname in the Location header value
HTTP::header replace Location [string map -nocase "http:// https:// 172.31.112.40 blrorsapp" HTTP::header value Location]]
}
}
I try the following 2 i-rule But the problem was not solved
when HTTP_RESPONSE {
if { [HTTP::header is_redirect]} {
Log original and updated values
log local0. "Original Location header value: [HTTP::header value Location],\
updated: [string map -nocase “http:// https:// :80/ /” [HTTP::header value Location]]" Do the update, replacing old.hostname.com with new.hostname.com and replacing http:// with https:// and :80/ with /
Actually the application put node ip address in the header, so if i set the rewrite redirect set to all the application is working but it shows the f5 vip in the client browser
& client wants the host name in browser insted of the f5 vip
Can you try something like this then to replace the node IP with the hostname?
when HTTP_RESPONSE {
Check if response is a 30x redirect
if { [HTTP::header is_redirect]} {
Rewrite http:// to https://, the IP to the hostname and remove the port reference in the Location header value
HTTP::header replace Location [string map -nocase "http:// https:// [IP::server_addr] blrorsapp :80/ /" HTTP::header value Location]]
}
}