Forum Discussion
Pool selection based on URI
Hi, I'm running into an issue where i'm trying to select a pool based on the URI.
For example, when we go to http://site.com/app1, it goes to pool p_app1 and when we go to https://site.com/app2, it goes to pool p_app2. Here is the simple iRule i've created.
when HTTP_REQUEST {
switch [string tolower [HTTP::uri]] {
"/app1" {
pool p_app1
HTTP::uri "/app1/"
}
"/app2" {
pool p_app2
HTTP::uri "/app2/"
}
}
}
The problem I have is that it works fine for app1 but not for app2.
When I enter http://site.com/app2/, it gives a 404 not found. When I enter http://site.com/app2, it works and the app redirects to http://site.com/app2/login. When I try to log into the page, it waits a long time and finally gives a "This page can’t be displayed".
Both apps work perfectly when accessed internally no matter is there is a trailing slash or not.
The issue is that i'm not the one who developped the so called website and cannot find any documentation.
Do any of you guys have ever ran into something like this and can you help out?
Thanks !
1 Reply
- Stanislas_Piro2
Cumulonimbus
the irule never match URI : /app2/login
and to redirect /app1 to /app1/ do a redirect and not HTTP::uri replacement. (I commented this part)
when HTTP_REQUEST { switch [string tolower [HTTP::uri]] { "/app1" { pool p_app1 HTTP::uri "/app1/" } "/app1*" { pool p_app1 } "/app2" { HTTP::redirect "/app2/" pool p_app2 HTTP::uri "/app2/" } "/app2*" { pool p_app2 } } }
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