Forum Discussion
Eric_Frankenfie
Sep 29, 2011Nimbostratus
Parsing URI to Make Pool Selection
I am trying to write an iRule which will read in a URI and then based on what it finds match the source IP address to data lists to make the pool selection. For example... URL: www.example....
Michael_Yates
Oct 27, 2011Nimbostratus
Hi Eric,
Try this:
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] contains "/ws/test.asmx" } {
if { [class match [IP::client_addr] equals poolA.AllowList] } {
log local0. "Permitted: [IP::client_addr] --> [HTTP::host][HTTP::uri]"
pool poolA
HTTP::redirect "http://www.google.com"
}
elseif { [class match [IP::client_addr] equals poolB.AllowList] } {
log local0. "Permitted: [IP::client_addr] --> [HTTP::host][HTTP::uri]"
pool poolB
HTTP::redirect "http://www.yahoo.com"
}
else {
log local0. "Denied: [IP::client_addr] --> [HTTP::host][HTTP::uri]"
discard
HTTP::redirect "http://www.msn.com"
}
}
}
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