log local0. "[IP::client_addr] - [whereis [IP::client_addr] country ]"
Add a log entry to see what the F5 is seeing:
when HTTP_REQUEST {
set allowed 0
if { !([whereis [IP::client_addr] country ] equals "EG") } {
log local0. "[IP::client_addr] - [whereis [IP::client_addr] country ]"
set allowed 1
}
if { ($allowed == 0) and ([HTTP::path] ends_with "/register") } {
HTTP::redirect "http://www.test.com/register"
} elseif { ($allowed == 1) and ([HTTP::path] ends_with "/register") } {
HTTP::redirect "http://www.test.com/login"
} else {
HTTP::redirect "http://www.test.com/login"
}
}