Forum Discussion
sundogbrew
Altocumulus
Mar 26, 2013irule to pick a number out of a URI and make it the port
I have developers who want to tie everything off the same URL and have it go to different ports on the same group of hosts. If you have been following my posts, it is almost the exact opposite probl...
What_Lies_Bene1
Cirrostratus
Apr 23, 2013Hmmm, I think I'm missing something here. Can you try this - just an extra log statement to record the original URI etc.
when HTTP_REQUEST {
set newuri [findstr [HTTP::uri] "/" "4"]
log local0. "Original request is: [HTTP::host][HTTP::uri]"
log local0. "New URI is: $newuri"
set newport [findstr [HTTP::uri] "/" "0" "/"]
HTTP::uri "$newuri"
log local0. "New Port is: $newport"
HTTP::header replace Host "[HTTP::host]:$newport"
if { $newport ne "" } {
Use the relevant Pool
pool pool_$newport }
else {
log local0. "Newport Variable was empty"
}
}
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