Forum Discussion
daveclarkjr
Nov 11, 2016Nimbostratus
host replace question with iRule
Is there any way to keep F5VSserver.null.com as the host? Would using HTTP::host be an option?
client request
https://f5VSserver.null.com/?uri=http://Server1.null.com/xyz/go?app_url=http:...
VernonWells
Nov 11, 2016Employee
Ah, so I assume what you really want is to change what comes after app_url= in the Request Query Parameters. Assuming that is the case, you can simply extend the
string map
set:
when HTTP_REQUEST {
log local0. "xyz_Forms = [HTTP::uri]"
if { [string tolower [HTTP::uri]] contains "xyz" } {
set uri [string map -nocase { "/?uri=http://Server1.null.com/xyz/" "/xyz/" "Server2.null.com:8000" "[HTTP::host]" } [HTTP::uri]]
log local0. "xyz_new = $uri" HTTP::uri $uri
}
}
That would change this Request Target:
/?uri=http://Server1.null.com/xyz/go?app_url=http://Server2.null.com:8000/http_handler/file.htm
into this:
/xyz/go?app_url=http://f5VSserver.null.com/http_handler/file.htm
assuming that the Host header is set to f5VSserver.null.com.
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