Forum Discussion
Eric_Frankenfie
Nov 13, 2017Nimbostratus
HTTP Path Modification and Response Rewrite
I have a VIP which is hosting multiple versions of the same application: the current version (/APP_APP1153/APP1153.ashx)is sent to the pool configured on the VS, /G1/APP_APP1153/APP1153.ashx is sent ...
Lee_Sutcliffe
Nov 13, 2017Nacreous
Good evening..
Seems to me you just want to rewrite URI between client and server. This can be done with [HTTP::uri] no need to collect the HTTP payload and complicated string replacement.
I've just put this very basic iRule together with should illustrate my thinking. I'm just setting a flag on HTTP request so that we know what to change the URI back to on response. Hopefully it might give you some ideas:
when HTTP_REQUEST {
set uri "/APP_APP1153/APP1153.ashx"
set g1 0
set g2 0
if {[HTTP::uri] equals "/G1/$uri" } {
[HTTP::uri] $uri
set g1 1
}
if {[HTTP::uri] equals "/G2/$uri" } {
[HTTP::uri] $uri
set g2 1
}
}
when HTTP_RESPONSE {
if {$g1} {
[HTTP::uri] "/G1/$uri"
}
if {$g2} {
[HTTP::uri] "/G2/$uri"
}
}
PS - I've not tested this (making the most of a delayed train! )
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