Forum Discussion

Justin_47030's avatar
Justin_47030
Icon for Nimbostratus rankNimbostratus
Jun 17, 2015

irule uri pool x else pool y

We have a vserver setup with persistence, pool, http profile etc. Developers want any traffic hitting abc.xyz.com/FOO to go to a specific pool of servers and all other traffic will go to the current pool in place. Would the irule below work for this?

 

when HTTP_REQUEST { if { [HTTP::uri] starts_with "/FOO" } { pool FOO } else { pool current_pool } }

 

1 Reply

  • i don't see any issue with your iRule. Please try below irule

                when HTTP_REQUEST {
                      if { [string tolower [HTTP::uri]] starts_with "/foo" } { pool foo } 
                else { pool current_poo  }
                             }