Forum Discussion
Icemanii_116694
Nimbostratus
Jan 02, 2014Block Opera Mini users using true client IP
I'm trying to restrict users from certain countries using Opera Mini browser from accessing my server. I'm using the following irule to replace the IP::client_addr field with the XFF IP:
when H...
mikeshimkus_111
Jan 02, 2014Historic F5 Account
Ah, I see. I didn't know that about Opera Mini. I thought you were looking at the X-Forwarded-For header as inserted by BIG-IP.
Couldn't you do something like this, then:
when HTTP_REQUEST {
if { [string tolower [HTTP::header "User-Agent"]] contains "mini opera" } {
if {[HTTP::header exists "X-Forwarded-For"]} {
set real_ip [HTTP::header value "X-Forwarded-For"]
if { [class match [whereis $real_ip country] equals BlockedCountry]] } {
drop
}
}
}
}
Icemanii_116694
Nimbostratus
Jan 02, 2014Thanks. I'll try it out to see if it works.
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