Forum Discussion

RAQS's avatar
RAQS
Icon for Cirrus rankCirrus
Jan 21, 2019

Multiple URL to One Node

Hi All,

 

I Want to direct the traffic from two urls ( say abc.com and xyz.com) to single node (1.1.1.1 8080) and other domain/url to rest of the pool members via iRule. Please note that all members are in same pool.

 

Thanks in advance. Shashank

 

1 Reply

  • Hi ShashankS,

    you could either

    switch
    the requests for the given
    HTTP::host
    values between two distinct
    pool
    objects (e.g. your regular pool an another pool with just
    1.1.1.1:8080
    as a member) or you could simply overwrite the load balancing decission by using the
    node
    command.

    iRule switching between two pools:

    when HTTP_REQUEST {
        switch -exact -- [string tolower [HTTP::host]] {
            "abc.com" - "xyz.com" {
                pool single_node_pool
            }
            default {
                pool regular_pool
            }
        }
    }
    

    Note: The example above can be combined with the Priority Group Activation feature for the "single_node_pool". By doing so you can define one or many standyby node(s) with a lower "Priority Group" value, so that those nodes will be used if the primary node will become offline.

    iRule to target a specific node:

    when HTTP_REQUEST {
        switch -exact -- [string tolower [HTTP::host]] {
            "abc.com" - "xyz.com" {
                node 1.1.1.1 8080
            }
            default {
                pool multiple_nodes
            }
        }
    }
    

    Cheers, Kai