Forum Discussion
irule not functioning
Hi Habib,
just noticed, that the ordering of your iRule is little faulty. You have to use the most restrictiv condition before the less restrictive conditions, otherwise then later conditions wouldn't trigger...
when HTTP_REQUEST {
set low_hostname [string tolower [HTTP::host]]
set low_uri [string tolower [HTTP::uri]]
if { ( $low_hostname equals "topsuat" ) and ( $low_uri starts_with "/socket.io" ) } then {
pool topsuat-socket-pool
} elseif { ( $low_hostname contains "topsstg" ) and ( $low_uri starts_with "/socket.io" ) } then {
pool topsstg-socket-pool
} elseif { ( $low_hostname equals "topssit" ) and ( $low_uri starts_with "/socket.io" ) } then {
pool topssit-socket-pool
} elseif { ( $low_hostname equals "topsstrg" ) and ( $low_uri starts_with "/socket.io" ) } then {
pool topstrg-socket-pool
} elseif { $low_hostname contains "topsfat" } then {
pool topsfat-prod-pool
} elseif { $low_hostname contains "topsstg" } then {
pool topsstg-pool
} elseif { $low_hostname contains "topssit" } then {
pool topssit-http
} elseif { $low_hostname contains "topstrg" } then {
pool topstrg-pool
}
Note: In addition I would recommend to check the host and pool names. You have "topsuat" (for
) but "topsfat" (for /socket.io
) and also a slightly mixed naming convention for the pool names which may cause additional confusion. Also check your /*
and contains
. Sometimes you're using one and sometimes the other...equals
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com