Forum Discussion

Chris_Corsaro_1's avatar
Chris_Corsaro_1
Icon for Nimbostratus rankNimbostratus
Apr 13, 2006

iRule to redirect to specific node

We are trying to send all traffic containing a specific uri to one server, however it doesn't seem to be working at this time. This is the iRule that we have setup.

 

 

when HTTP_REQUEST {

 

set uri [string tolower [HTTP::uri]]

 

if { $uri starts_with "/csconsole" } {

 

node 10.x.x.x:XXXX

 

}

 

}

 

 

Is there something in our iRule that is missing or needs to be reconfigured?

 

 

This is a high priority issue so if someone can help us as soon as possible that would be greatly appreciated.
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Your syntax looks VERY close to correct. Try seperating the IP and port numbers with a space, instead of a colon.

    Like this:

    
    when HTTP_REQUEST {
      if { [string tolower [HTTP::uri] ] starts_with "/csconsole" } {
        node 10.x.x.x XXXX
      }
    }

    Colin
  • Initial results look good. Thanks for your help. I will get back to you if we have any issues.

     

     

    Thanks again.

     

    Chris