Forum Discussion

Joshua_Rasnier's avatar
Joshua_Rasnier
Icon for Nimbostratus rankNimbostratus
Feb 03, 2014

Request always going to default

Hi guys,

Hope someone can help me with a problem I have been trying fix for one day.

I have a virtual server with client side ssl,server ssl and using cookie persistence. And has the below irules in the same order.

irule1

    when HTTP_REQUEST {

    switch -glob [HTTP::path] {
        "/path1*" {
               pool POOL_serverpool2
               }
        "/path2*" { 
               pool POOL_serverpool2
               }
        "/path3*" { 
               pool POOL_serverpool2
               }
    }
    }

irule2

    when SERVER_CONNECTED  {

    switch -glob [LB::server addr] {  
        "168.217.1.1" {
        SSL::profile "serverssl_server3"
            } 
        "168.217.1.2" {
        SSL::profile "serverssl_server4"
            }
        "168.217.1.8" {
        SSL::profile "serverssl_server5"
            }
        }
    }

For some reason the first irule is never being matched even though my paths are correct or its not directing it to the non-default pool.

I have done this kind of rules before only difference is that irule2 was matching a pool and not individual servers, but cannot see how this would make a difference. In irule2 servers 3 (168.217.1.1) and 4 (168.217.1.2) are part of a default pool. But server 5(168.217.1.8) is part of POOL_serverpool2.

15 Replies

  • That's why you should always use;-

        switch -glob [string tolower [HTTP::path]] {
    

    and then have all your switch arms using lower case. Then an application person can never mess you up.

  • Correct me if I am wrong but doesn't that change the requested path and not what is sent to the pool member? So the uri sent to the server will always be lower but if the application isn't lower case then will be rejected anyways.

     

  • [string tolower [HTTP::path]] isn't an assignment, it's a string evaluation. It'd be like saying:

    set x [HTTP::path]
    set y [string tolower $x]
    

    If you wanted to actually change the case of the path to the server, you'd need to do something like this:

    HTTP::path [string tolower [HTTP::path]]