aFlex server selection by uri

Community Forum Forums Thunder and AX Series aFleX aFlex server selection by uri

This topic contains 2 replies, has 2 voices, and was last updated by avatar tummeli 1 year, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12002
    avatar
    tummeli
    Member

    Hi,

    I would need to do a aFlex script that would match http://www.domain.tld/test and then forward traffic only to one server ip-address, instead of loadbalancing with two servers. I have made the following aFlex script:

    
    # aFleX script for URL Rewrite
    # Direct /test to www1 10.0.01
    #
    when HTTP_REQUEST {
    if [HTTP::uri] contains "/test"
    set target 10.0.0.1
    }
    

    My AX says that the script is ok, but it does not forward traffic only to 10.0.0.1, but also to another host.

    #12012
    avatar
    diederik
    Member

    Hello,

    What you are currently doing, is just setting a variable.

    You need the “node” command.

    
    when HTTP_REQUEST {
        if { [HTTP::uri] contains "/test" } {
            node 10.0.0.1
        }
    }
    
    #12022
    avatar
    tummeli
    Member

    Hi,

    Thank you diederik! That seems to work now.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.