Forum Discussion
Chris_Miller
Altostratus
Aug 12, 2010Limit Access to URI to HTTPS and IP
I'm interested in the best way to do this.
I want to limit access to the URI "/sample" to users from IP 1.1.1.1 while also only allowing said access to be HTTPS. If someone tries hitting it over HTTP...
Chris_Miller
Altostratus
Aug 12, 2010How's this look?
when HTTP_REQUEST {
if { [HTTP::uri] eq "/sample" and !( [HTTP::header "True-Client-IP"] eq 1.1.1.1 ) and ! ([TCP::local_port] eq 443 ) } {
reject }
}
Edit - looks like this wouldn't work...user with that URI, 1.1.1.1 but port 80 wouldn't get rejected, gonna have to make it an if/else I think.
How bout this:
if { [HTTP::uri] eq "/sample" and !([[HTTP::header "True-Client-IP"] eq 1.1.1.1] and [[TCP::local_port] eq 443]) }
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