Forum Discussion
J_Drew_160974
Nimbostratus
Jun 16, 2014How to use an Irule switch to match HTTP::host and HTTP::uri?
Hi
I could use some advice about an irule that is not working for me. I have sanitised the urls.
I have no control over the URL's of the hosted applications. As you can see the HTTP::host needs t...
Cory_50405
Noctilucent
Jun 16, 2014I'd suggest putting a logging statement in your problematic match clause and verify what you are expecting to see in the log:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host][HTTP::uri]] {
"www.liveapp.customer.co.uk/app1" {
pool CUST1-WEB-PROD-APP1-Pool
SSL::disable serverside
}
"www.testapp.customer.co.uk/app1" {
pool CUST1-WEB-PROD-APP1-test-Pool
SSL::disable serverside
}
"www.liveapp.customer.co.uk/app2easypath" {
pool CUST1-WEB-PROD-APP2-Pool
SSL::disable serverside
HTTP::path [string map { /app2easypath /realpath } [HTTP::path]]
}
"www.testapp.customer.co.uk/app2easypath" {
pool CUST1-WEB-PROD-APP2-test-Pool
SSL::disable serverside
HTTP::path [string map { /app2easypath /realpath } [HTTP::path]]
log local0. "Request to the server is [HTTP::host][HTTP::uri]"
}
"www.liveapp.customer.co.uk/" {
pool CUST1-WEB-PROD-Default-Pool
SSL::disable serverside
}
"www.testapp.customer.co.uk/" {
pool CUST1-WEB-PROD-Default-Pool
SSL::disable serverside
}
default { HTTP::redirect http://www.google.com} }
}
}
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