Forum Discussion
darrenclegg_199
Feb 21, 2011Nimbostratus
URL and ip address blocking
I have an iRule that blocks users from using an ip address to access our sites and also stops the wrong URL accessing it (this was done because of an error in a forwarding rule on our proxy).
This rule blocks incorrect URLs and ip addresses from accessing the website (incase of misconfiguration on forwarding host)
when HTTP_REQUEST { if { not ([string tolower [HTTP::uri]] starts_with "/mysite.com/") }{
HTTP::respond 200 content \ "Wrong URL entered Access to this URL is not allowed using this method. Please inform the Network Administrator." "Content-Type" "text/html" } }
This works but is specific to mysite.com. Is there any way i can make this generic to all sites based on an allowed url list on ASM or any other method
cheers Darren
2 Replies
Sort By
- You could use a class/data group that contains all of the allowed URLs and if HTTP::uri doesn't start with one of them, issue the same response. Is that what you're after?
- i have set up a http_class and added the URL allowed list and applied it to the profile. i didn't need any iRule statement.
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