Forum Discussion

3 Replies

  • I would start by checking out the iRule 101 set of articles to get an idea of how to write iRules.

    To accomplish what you want, you'll want to use both HTTP::uri to update the uri (e.g. from

    /users?id=123
    to just
    ?id=123
    ) and then you could either use the pool command and use separate pools with different node/port combinations, or use one pool with both and use the node command to specify which node to use (I'd recommend the pool method personally). The irules 101 links will have clarify some things.

    to get started, you might use something like this:

    when HTTP_REQUEST {
        switch -glob --[string tolower [HTTP::uri]] {
            "/users?id=*" {
                pool POOL_NAME_1
                HTTP::uri [string map -nocase {/users /} [HTTP::uri]]
            }
            "/trades" {
                pool POOL_NAME_2
            }
            "/groups" {
                pool POOL_NAME_3
            }
            default {
            }
        }
    }