Forum Discussion
ngaze_66812
Sep 14, 2011Nimbostratus
URL restrictions for public and class
What I'm attempting to do with the below iRule (and struggling to accomplish) is to allow public addresses to connect to the servers after coming in with a /home request, but then to restrict access to certain networks when requesting /web-services. All other requests should be getting rejected. I've been tweaking this rule trying to get it to work for quite a while and after applying in it's current state it is still allowing access to /*. Any help on this is appreciated.
when HTTP_REQUEST {
if {[HTTP::uri] contains "/home" } {
pool server_pool
}
elseif {[HTTP::uri] contains "/web-services"} {
if {[matchclass [IP::client_addr] equals allowed_networks] }{
pool server_pool
}
else {
reject
}
}
else {
reject
}
}
- Michael_YatesNimbostratusHi ngaze,
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/home*" { pool server_pool } "/web-services*" { if { [class match [IP::client_addr] equals allowed_networks] }{ pool server_pool } } default { reject } } }
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