Forum Discussion
ben_svobodny_18
Nimbostratus
Mar 18, 2015change in behavior from v10 to v11 with HTTP:HOST
I have ran into an issue with an irule that is working fine on version 10, but doesn't work on version 11.
In version 10 we can rewrite the HOST value, but still make parsing decisions off of th...
Michael_Jenkins
Cirrostratus
Mar 18, 2015You could grab the original host value into a variable and base it on that. Otherwise, I'm not sure of a way to get the original once you modify it.
You could update your iRule to something like this:
set origHost [HTTP::host]
set apiHostProd "test.com"
set apiPoolProd "test.com-81"
if { [class match $cmd equals "api_commands"] } {
HTTP::host $apiHostProd
HTTP::header replace "Host" $apiHostProd
}
switch -glob -- [string tolower $origHost] {
"*resell01*" {
pool $apiPoolProd member 10.7.58.28 81
}
"*resell02*" {
pool $apiPoolProd member 10.7.58.29 81
}
"test.com" {
pool $apiPoolProd
}
default {
HTTP::respond 200 content { Error Message To Return To User }
return
}
}
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