Forum Discussion

mbleiweiss_2986's avatar
mbleiweiss_2986
Icon for Nimbostratus rankNimbostratus
Dec 08, 2016

iRule to append URI and send to pool members

I have the current iRule set up and working fine:

when HTTP_REQUEST {
  switch [string tolower [HTTP::host]] {
    "clinicalapps.intouchstaging.com" {
      if { [HTTP::uri] equals "/osu" } {
       HTTP::redirect "https://[HTTP::host]/webapp"
      }
      else {
       pool OSU_kainos_pool
      }
    }
    default {
      discard
    }
  }
}

Moving forward, I will need to add more pool members for different URIs. This one sends the client to a specific pool if the URI is "/osu" and changes the URI to "/webapp"

Next, I want to add another one if the URI is "/tristar" and do the same thing, change the URI to "/webapp" and then send to a different pool member.

I can't figure out how to modify the iRule to do a different pool based on URI, it breaks it whenever I try. Any help you guys can lend would be greatly appreciated.

1 Reply

  • You need something like this if you want to modify URI and send it to the pool instead of redirecting:

      if { [HTTP::uri] equals "/osu" } {
      HTTP::uri "/webapp"
      pool POOL_webapp
      }