Forum Discussion

fbdeir_29119's avatar
fbdeir_29119
Icon for Nimbostratus rankNimbostratus
Jun 16, 2011

forwarding

Hi, I want to forward traffic destined to certain directory to a specific server, like traffic coming to :https://www.mydomaion.com/access/index.aspx to be forwarded directly to server with ip address 192.168.10.15 . any idea on how to achieve that using iRules?

5 Replies

  • is something like this?

    
    when HTTP_REQUEST {
         if {[string tolower [HTTP::host]] equals "www.mydomaion.com" and \
              [string tolower [HTTP::uri]] equals "/access/index.aspx"} {
              node 192.168.10.15 80
         }
    }
    
  • I'd try setting this up on a test virtual server. Nitass' example will do exactly what you described, but it's worth it to test first.

     

     

    Aaron
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    nitass' code looks solid, and if you're looking to do this for a single URI / host pair it will work just fine (though Aaron's right, always test first). If you're looking to do multiple URI/host pairs, keep the class command in mind (if you're on v10 or later, the findclass command pre v10). Creating a data group that maps the URI to the desired host/port would be ideal for managing large numbers of these mappings, if you need to go that route.

     

     

    Colin