How 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 to be matched in order to determine if it a live or test app being requested. The HTTP::uri needs to be matched in order to determine which app is needed. the customer has a load of web forms that they use behind the /* match... and so the actual default is unlikley to be used unless the client types something odd. I also have no control over the odd fact that app2 is access via a client via app2easypath, yet the website is on /realpath.
What seems to be happening is when we try to go to "www.testapp.customer.co.uk/app2easypath/" we end up being redirected to the default website.
Any help on where i have gone wrong would be great. Thanks J ........ rule IRULE-CUST1-WEB-PROD-SSL
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]]
}
"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
}
}
}