aFlex server selection by uri

tummelitummeli Member
Hi,

I would need to do a aFlex script that would match 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.

Comments

  • diederikdiederik Member
    edited June 2017
    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
        }
    }
    
  • tummelitummeli Member
    edited June 2017
    Hi,

    Thank you diederik! That seems to work now.
Sign In or Register to comment.