Forum Discussion
jokragly
Sep 14, 2017Nimbostratus
rewrite iRule issues Request & Response
I am having major issues with a rewrite iRule I am trying to get to work. I am running 11.5.3
I have an application that works internally with a horrible name and uri (not FQDN), and the applic...
Jad_Tabbara__J1
Sep 14, 2017Cirrostratus
Hi,
Could you add the following and check /var/log/ltm to see if its matching correctly...
when HTTP_REQUEST {
if { [HTTP::uri] equals "/newapp" } {
Remove the "Accept-Encoding" header
HTTP::header remove "Accept-Encoding"
In case the server complains, set the host header.
HTTP::header replace Host "horriblename:8088"
Finally change the URI while on its way to server.
HTTP::uri /site/app/default.aspx
}
Disable the stream filter for all requests
STREAM::disable
}
when HTTP_RESPONSE {
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, horriblename:8088 with newname.domain.com, /site/app/default.aspx with newapp
STREAM::expression [list {@http:\@https:\@} {@horriblename:8088@newname.domain.com@} { @/site/app/default.aspx@/newapp@} ]
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]"
}
Waiting for your feedback
Regards
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects