Forum Discussion

Ron_130795's avatar
Ron_130795
Icon for Nimbostratus rankNimbostratus
Jul 16, 2014

Need Assistance with iRule on adding multiple pools

My default pool is prod.ria.internal.com which works. However when I type in my url of testing.com/application the iRule is not using the /application pool. Any thoughts? Thanks in advance.

 

when HTTP_REQUEST { Check requested uri header (set to lowercase) switch -glob [string tolower [HTTP::uri]] { "/blog" { pool prod.ola.internal.com } "/application" { pool prod.ola.internal.com } default { pool prod.ria.internal.com } } }

 

5 Replies

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus

    Could it be that the request adds a trailing slash? You're not looking for that in the switch. You could see what happens if you add an asterisk to your criteria:

    when HTTP_REQUEST { 
    
         Check requested uri header (set to lowercase) 
    
        switch -glob [string tolower [HTTP::path]] { 
    
            "/blog*" { 
    
                pool prod.ola.internal.com 
    
            } 
    
            "/application*" { 
    
                pool prod.ola.internal.com 
    
            } 
    
            default { 
    
                pool prod.ria.internal.com 
    
            } 
    
        } 
    
    }
    
  • The iRule example is syntactically correct, so I'd say there could be one of two problems:

     

    1. The pools are incorrectly configured, and requests are potentially going to the wrong server(s), or:

       

    2. The URI patterns are incorrect. The best way to troubleshoot this is with a client side capture of a browser communicating directly with the application.

       

  • Thanks Kevin.

     

    When I type in prod.ola.internal.com/application or /blog I get a "Cannot GET /application" error or "Cannot GET /blog" error

     

  • I also can browse to the application and blog page using the server IP and port with no issues.

     

    Understood. So if you go directly to the server, you don't have a problem getting to the application. The next steps should be:

     

    1. Perform a tcpdump on the external interface of the F5 and make your request. Do you see the traffic coming from the client to the VIP?

       

    2. Perform a tcpdump on the internal interface of the F5 and make your request. Do you see the traffic from the client going to the (correct) server? If so, do you see the server responding back through the F5?

       

    3. Perform a client side HTTP capture and look at the HTTP requests and responses. Do you see an HTTP response from the server?