Forum Discussion
Mohammed_Moin_2
Nimbostratus
Sep 25, 2018Allowing specific source to specific uri and deny rest all
Hi All,
We need an irule that can allow only specific source IP’s to access specific URI and deny to others. For example
Data Group Source IP: 10.1.1.1 [DG1]
URI: https://www.testdev.com/services/use...
Leonardo_Souza
Cirrocumulus
Sep 25, 2018Normally you do this based in the path, because is likely the application will have multiple pages:
when HTTP_REQUEST {
if [class match [IP::client_addr] equals "DG1"] {
if { not ([HTTP::path] starts_with "/services/user1/"]) } {
HTTP::redirect "https://www.testdev.com/services/user1/"
return
}
drop
}
If you really want the URI:
when HTTP_REQUEST {
if [class match [IP::client_addr] equals "DG1"] {
if { not ([HTTP::uri] starts_with "/services/user1.html"]) } {
HTTP::redirect "https://www.testdev.com/services/user1.html"
return
}
drop
}
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
