Forum Discussion

F5-Oetti's avatar
F5-Oetti
Icon for Nimbostratus rankNimbostratus
Mar 15, 2018

Go to different Pools depending on URL

I have a request to get the following to work:

curl -sSL -D - -o /dev/null should point to CAD_Pool_36 curl -sSL -D - -o /dev/null should point to CAD_Pool_38 anything else should (no A or B in URL) should point to CAD_Pool (default-Pool). Therefore I created an iRule but the choice is every time the CAD_Pool.... nothing else... why does that not work?

when HTTP_REQUEST { log local0. "CAD_My request received" if { [string tolower [HTTP::path]] contains "preview/A" } { log local0. "CAD_My Pool36" pool CAD_Pool_36

}
elseif { [string tolower [HTTP::path]] contains "preview/B" } {
log local0. "CAD_My Pool38"
      pool CAD_Pool_38 
                }
 else {
 log local0. "CAD_My request DefaultPool"
  pool CAD_Pool
 }
}
when SERVER_CONNECTED {
log local0. "Connection from [IP::client_addr]:[TCP::client_port] to Server: [IP::server_addr]:[TCP::server_port] established."

}

Any good Tip is highly appreciated...

Best Regards Jerry

1 Reply

  • conditions

    [string tolower [HTTP::path]] contains "preview/A"
    and
    [string tolower [HTTP::path]] contains "preview/B"
    will never match because :

    • [string tolower [HTTP::path]] returns a string in lowercase
    • "preview/A" contains an uppercase character