06-Oct-2020 08:01
Hello
I am having requirement to setup new url "example.com" and when user try to access
"example.com/user1" traffic should be on "pool1"
"example.com/user2" traffic should be on "pool2"
"example.com/user3" traffic should be on "pool3"
.
.
"example.com/user500" traffic should be on "pool500"
Need dynamic way to achieve this, instead of writing 500 lines of code.
Please advice.
Thanks,
Amit
06-Oct-2020
08:59
- last edited on
04-Jun-2023
21:16
by
JimmyPackets
Hi Amit,
Can you try this iRule?
when HTTP_REQUEST {
if { [HTTP::host] equals "example.com" && [HTTP::uri] matches_regex {\/user[0-9]{1,3}} } {
set poolID [string trimleft [HTTP::uri] "/user"]
set poolname "pool$poolID"
# log local0. "poolname: $poolname"
pool $poolname
}
}