Forum Discussion
mengler_136249
May 11, 2017Nimbostratus
Geoblocking/Redirects
Summary
Today we do geoblocking within AFM to only allow specific countries to connect to our virtual servers. I have a request for one specific virtual server to no longer drop the connection, ...
Hannes_Rapp
May 11, 2017Nimbostratus
This is GeoIP iRule ref. The code below will redirect any clients from China to a dedicated .cn web site. Modify as needed. You will need to use 2-letter country code as identifier. You may look up the codes for each country here: http://www.nationsonline.org/oneworld/country_code_list.htm (ISO Alpha2 Code)
when HTTP_REQUEST {
if { [whereis [IP::client_addr] country] eq "CN" } {
HTTP::respond 302 Location "https://www.site.cn" Connection Close
event disable
}
}
Requires a HTTP profile attached to Virtual Server.
Warning: Written in notepad and untested.
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