Forum Discussion

Shuvo_166796's avatar
Shuvo_166796
Icon for Nimbostratus rankNimbostratus
May 05, 2015

Policy for URI Based Pool Selection

I've been trying to utilize LTM's Policy to select pool. When default pool is selected everything is working as expected but when the PATH is matched and the other pool is selected, I'm just getting 404. Below is my configuration.

[shuvo@zeus:Active:Standalone] ~  tmsh list ltm virtual foo_vs
ltm virtual foo_vs {
    destination 192.168.34.112:https
    ip-protocol tcp
    mask 255.255.255.255
    persist {
        cookie {
            default yes
        }
    }
    policies {
        _pool_forward_policy
    }
    pool foo_pool
    profiles {
        tcp { }
        domain.tld_client_ssl {
            context clientside
        }
        wl_http { }
    }
    rules {
        _failover_pool
        _insert_server_id
    }
    source 0.0.0.0/0
    vs-index 9
}
[shuvo@zeus:Active:Standalone] ~  tmsh list ltm pool foo_pool
ltm pool foo_pool {
    load-balancing-mode least-connections-member
    members {
        app01-domain.tld:afs3-callback {
            address 192.168.35.71
            session monitor-enabled
            state up
        }
    }
    monitor appStatus 
    service-down-action reselect
}
[shuvo@zeus:Active:Standalone] ~  tmsh list ltm pool bar_pool
ltm pool states {
    members {
        app02-domain.tld:webcache {
            address 192.168.35.72
            session monitor-enabled
            state up
        }
    }
    monitor appStatus 
    service-down-action reselect
}
[shuvo@zeus:Active:Standalone] ~  tmsh list ltm policy _pool_forward_policy
ltm policy _pool_forward_policy {
    controls { forwarding }
    requires { http }
    rules {
        _states_forward_rule {
            actions {
                0 {
                    forward
                    select
                    pool /Common/bar_pool
                }
            }
            conditions {
                0 {
                    http-uri
                    case-sensitive
                    values { /bar }
                }
            }
            ordinal 1
        }
    }
    strategy first-match
}

2 Replies

  • when the PATH is matched and the other pool is selected, I'm just getting 404.

     

    is that path valid on member of bar_pool pool? do you get 404 if you browse bar_pool pool member directly using that path?

     

  • Yes the path exists on bar_pool but not on foo_pool. So the forwarding wasn't working. I've achieved that with an iRule instead of policy.