Forum Discussion
http::path trailing slash
iRule for a port 443 virtual server with ssl.
when HTTP_REQUEST {
if { [HTTP::path] starts_with "/GoogleAltLogin-2.0.7" } {
pool googleAltLogin
} elseif { [HTTP::path] starts_with "/banner-mobileserver" } {
pool MobileServer
} elseif { [HTTP::path] starts_with "/banner-mobileserver/" } {
pool MobileServer
} else {
pool HTTP_80
}
}
This works: https://mysite/banner-mobileserver/ - It correctly chooses the "MobileServer" pool, and I am able to see a 'welcome to grails' page.
This does not work: https://mysite/banner-mobileserver - It appears to be using the "else" choice and using pool HTTP_80
If I bypass the load balancer and do WGET's locally on the server, it works with or without a trailing slash, so it is for sure the F5.
How can I make the F5 use the "MobileServer" pool for a URL that either has, or does not have, a trailing slash?
3 Replies
- Kevin_Stewart
Employee
Could it perhaps be something else in the request process causing this? Are you trying this with a browser or cURL? Please try this version and report the results:when HTTP_REQUEST { log local0. "path = [HTTP::path]" log local0. "uri = [HTTP::uri]" if { [HTTP::path] starts_with "/GoogleAltLogin-2.0.7" } { log local0. "google" pool googleAltLogin elseif { [HTTP::path] starts_with "/banner-mobileserver/" } { log local0. "slash" pool local-pool } elseif { [HTTP::path] starts_with "/banner-mobileserver" } { log local0. "no slash" pool local-pool } else { log local0. "default" pool local-pool-single } } - jwhitene
Nimbostratus
Sorry, this ended up having nothing to do with the F5. It is a quirk of tomcat.
Looking at the http headers, typing in "https://mysite/tomcat-webapp" , and I could see that there was a 302 redirect to "http://mysite/tomcat-webapp/" issued by tomcat.
Thank you for the reply though.
- Kevin_Stewart
Employee
If you set "redirect rewrite" to "matching" in the HTTP profile, it'll catch these HTTP 30x redirects and rewrite them to HTTPS automatically.
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
