Forum Discussion
redirect by pool help
url https://b-unitynet.mysite.com/Unity/Akcelerant.asmx url https://b-unitynet.mysite.com/weblet.asmx
I need to redirect to a pool otherwise defaul pool. below is what I have but does not seem to be redirecting..can you see any error in my irule.
when HTTP_REQUEST { if { ([string tolower [HTTP::host]]) contains "b-unitynet.mysite.com" } { switch -glob -- [string tolower [HTTP::uri]] { "akcelerant.asmx" { pool B-WebServices } "weblet.asmx" { pool B-WebServices } default { pool B-Unitynet} }
} }
4 Replies
- Richard__HarlanHistoric F5 Account
This is most likely happening because the first request is being LB to the default pool. To fix this if can turn on oneconnect. This will tell the LTM to LB each HTTP request from the client and allow the iRule to route the request to the correct pool. You can also perform a LB::detach and then have the pool send the request to the correct pool.
- Kevin_Stewart
Employee
A URI always starts with "/", so
"/akcelerant.asmx"would be more appropriate. And since you're using a glob, the following would also work:
"*akcelerant.asmx*" - Gill_32697
Nimbostratus
I turned on onconnect and added LB::detach but still not redirecting me, im getting sent to the default pool and getting default page. My browser url is http://b-unitynet.mysite.com/unity/weblet.asmx ! ! when HTTP_REQUEST { if { ([string tolower [HTTP::host]]) contains "b-unitynet.mysite.com" } { LB::detach switch -glob -- [string tolower [HTTP::uri]] { "/akcelerant.asmx" { pool B-WebServices } "/weblet.asmx" { pool B-WebServices } "/unitysailws.asmx" { pool B-WebServices } }
} } - StephanManthey
Nacreous
Please add a log statement in the context of HTTP_REQUEST as follows:
log local0. "URI: [HTTP::uri] Path: [HTTP::path] Query: [HTTP::query]"Monitor the log file:
tail -f /var/log/ltmPerhaps you will notice a trailing query in your incoming requests.
In this case the switch decission could be made based on [HTTP::path] or to follow Kevins advice by just adding a trailing '*' to each jump mark.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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