For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

jwhitene's avatar
jwhitene
Icon for Nimbostratus rankNimbostratus
Jul 31, 2013

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

  • 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
    }
    }
    

  • 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.

     

     

     

  • If you set "redirect rewrite" to "matching" in the HTTP profile, it'll catch these HTTP 30x redirects and rewrite them to HTTPS automatically.