iRule to modify http response
Hello all,
Seeking some assistance with modifying a http response from a server back to a client.
Senario is as follows (All web traffic)
- VS_A answers on 443 and sends to pool members on 9999
- VS_B answers on 888 and sends to same pool members on 7777
- When browsing to VS_B, there is a function that is on the site that responds with the public url of VS_A (ex https://www.acme.com:9999) instead of https://www.acme.com and hence causes a timeout because the clients are not able to access that port directly.
I am seeking to remove the port but keep all uri information.
Additionaly
Do I need any specific settings for the VS in order for this to work?
I have http-wxff profile I have sslclient profile I have sslserver profile
am I missing anything obvious?
Update....... I am trying below
I am attempting to modify a server response back to the client. I am attempting to remove the port from the url the client receives while still perserving the case and uri information.
When attempting this I notice no 302 response (Using firefox) and no location information. Seeking help to get this sorted.
when HTTP_REQUEST { Disable the stream filter for requests STREAM::disable
Remove this header to prevent server from compression response
HTTP::header remove Accept-Encoding
} when HTTP_RESPONSE { set internal_host "xxx.yyy.com" set external_host "boy.girl.com" Rewrite the Location header for redirects if { [HTTP::header exists Location] }{ HTTP::header replace Location [string map "$internal_host $external_host" [HTTP::header Location]] }
Rewrite the response content using a stream profile if it is text
if { [HTTP::header Content-Type] contains "text" } {
Set the stream expression with the find/replace strings
STREAM::expression "@$internal_host@$external_host@"
Enable the stream filter
STREAM::enable
}
}