Forum Discussion
iRule assistance
Looks like this iRule you require. condition sequence can be changed based on the preference.
when HTTP_REQUEST { if { !([class match [HTTP::uri] contains api_string])} { discard log local0. "connection DISCARDED from [IP::client_addr]" } elseif { [HTTP::path] starts_with "/resources/" } { pool pool_atldevngn } else { pool pool_atlapipool1 } }
Do you want all requests going to /resources/ to be allowed and sent to pool pool_atldevngn even if the URI does NOT contain one of the values in the data group api_string? If so, the following might work also:
1) Checks if the URI contains one of the values in data group *api_string. If it it DOES, then send the request to pool pool_atlapipool1. If it does NOT, then:
2) Check if the path starts with /resources/. If it does, send the request to pool pool_atldevngn. If not, discard (drop) the request
when HTTP_REQUEST {
if { !([class match [HTTP::uri] contains api_string])} {
if { [HTTP::path] starts_with "/resources/" } {
pool pool_atldevngn
}
else {
discard
log local0. "connection DISCARDED from [IP::client_addr]"
}
}
else {
pool pool_atlapipool1
}
}
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