Forum Discussion
Jad_Tabbara__J1
Sep 23, 2017Cirrostratus
Hi VRN,
Could you try the following irule
when HTTP_REQUEST {
Remove the "Accept-Encoding" header
HTTP::header remove "Accept-Encoding"
Disable the stream filter for all requests
STREAM::disable
}
when HTTP_RESPONSE {
if {[HTTP::header exists Location] } {
log local0. "Old Location is: [HTTP::header Location]"
HTTP::header replace Location [string map {"xyz.com:4444" "xyz.com"} [HTTP::header Location]]
log local0. "New Location is: [HTTP::header Location]"
}
Check if response type is text
if { [HTTP::header value Content-Type] contains "text" || [HTTP::header value Content-Type] contains "xml" } {
Replace http with https, xyz.com:4444 with xyz.com
STREAM::expression [list {@http:\@https:\@} {@xyz.com:4444@xyz.com@} ]
Enable the stream filter for this response only
STREAM::enable
}
}
when STREAM_MATCHED {
Log each match found by the stream filter
log local0. "Stream filter matched: [STREAM::match]"
}
N.B: Add a stream profile and you can check the logs in /var/log/ltm normally if the rewrite works fine, it will logs each match found...
Waiting for you feedback
Regards