Forum Discussion
JVV_137012
Nimbostratus
Apr 28, 2016URL rewrite (or HTTP forwarding) using iRule?
Hi All,
Could you please comment on the requirement below?
HTTP client sends out an HTTP request with POST data and a header, say Header_1
Proxy (F5-LTM) should:
a. fetch the ...
Stefan_Klotz
Cumulonimbus
Apr 29, 2016The HTTP response doesn't need to be manipulated, that's already too late.
If I understood Jatin correctly, he has one form pointing to the VS, but depending on a header value it needs to be "translated"/forwarded to different URIs towards the servers in the pool. Redirect is not allowed/possible, which would by the way also a little bit tricky with POST-requests.
I would go with a DGL like this:
ltm data-group internal /Common/header_uri_mapping {
records {
header1 {
data /uri1
}
header2 {
data /uri2
}
}
}
And an iRule like this:
WHEN_HTTP_REQUEST {
set new_uri [class match -value [HTTP::header "header1"] equals header_uri_mapping]
if { $new_uri ne "" }{
HTTP::uri $new_uri
}
}
Ciao Stefan 🙂
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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