Forum Discussion
jimmasters_1227
Nimbostratus
Apr 08, 2013Blocking access to certain URI except from IP Address
Hi All,
I am trying to block access to the admin sections of my website, unless the request comes from one of my public IP addresses.
The rule I tried to implement looks like ...
jimmasters_1227
Nimbostratus
Apr 11, 2013I got it working using a HTTP::respond statement. The reject statement was causing problems and was blocking all traffic instead of just the Admin URI. I also removed the URL section from the beginning as this iRule is only applied to a single VIP.
when HTTP_REQUEST {
if { ( ( [string tolower [HTTP::uri]] equals "/provider/faces/provider.jspx" ) or ( [string tolower [HTTP::uri]] equals "/faces/admin.jspx" ) or ( [string tolower [HTTP::uri]] equals "/reporting/BOE/BI" ) ) and not( [matchclass [IP::remote_addr] equals $::MyIPAddressRange ] ) } {
HTTP::respond 200 content "URL Denied"
return
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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