Forum Discussion
iRule node directive not working with SSL terminated virtual server
- Jun 26, 2017
Have you considered changing the switch to something like this? Seems buggy that http works but not https, but I would think the query is the better aspect to select from.
switch -glob [string tolower [HTTP::query]] { "s=prodapp2" { node 192.168.196.43 } }
Have you considered changing the switch to something like this? Seems buggy that http works but not https, but I would think the query is the better aspect to select from.
switch -glob [string tolower [HTTP::query]] {
"s=prodapp2" { node 192.168.196.43 }
}
Maybe ekaleido's answer was the key. I changed the "switch -glob [string tolower [HTTP::uri]]" to "switch -glob [string tolower [HTTP::query]]" and it started working. Note - I had already added port 80 to the "node" command. The full snippet now looks like:
if {[string tolower [HTTP::uri]] contains "_monitor" } {
switch -glob [string tolower [HTTP::query]] {
"*prodapp2*" {
node 192.168.196.23 80 }
"*prodapp3*" {
node 192.168.196.33 80 }
"*prodapp4*" {
node 192.168.196.43 80 }
}
}
And all is well. I don't understand why it sometimes finds a string located in the query string within HTTP::uri and other times not but that's okay...
Thanks!
Recent Discussions
Related Content
* 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