Forum Discussion
MR_Freddy_31338
Nimbostratus
Jan 30, 2019IRule Customization
We have a requirement to create irlue with the following logic
We have One VS and Two POOL (Pool x and Pool Y)and differentiate the traffic based on requested hostname by the following irule ...
Andy_McGrath
Cumulonimbus
Jan 30, 2019I think the following should work for you:
when HTTP_REQUEST {
set selectedPool [LB::server pool]
set lowerHost [string tolower [HTTP::host]]
set lowerPath [string tolower [HTTP::path]]
if {$lowerHost ends_with "auction.com"} {
set clientIP [getfield [IP::client_addr] "%" 1]
if {($lowerPath starts_with "/test/admin") && !(([IP::addr $clientIP equals 10.10.10.0/24]) || ([IP::addr $clientIP equals 20.20.20.0/24]))} {
reject
}
set selectedPool Auction-Pool
} elseif {$lowerHost ends_with "test.com"} {
set selectedPool test-Pool
}
pool $selectedPool
}
I have also published as a snippet here Snippet: irule-customization-63561
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
