Forum Discussion
Thomas_Gobet_91
Jan 08, 2014Cirrostratus
Hi,
I would do a "foreach" to check WFF value, because your request can travel through multiples proxies.
when CLIENT_ACCEPTED {
Save the name of the VS default pool
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
if { [string tolower [HTTP::header "User-Agent"]] contains "opera mini"} {
if {[HTTP::header exists "X-Forwarded-For"]} {
foreach real_ip [split [string map [list " " ""] [HTTP::header "X-Forwarded-For"]] ","] {
if {([class match [$real_ip] equals WhitelistIP]) } {
pool $default_pool}
elseif {([class match [$real_ip] equals BlacklistIP]) } {
HTTP::redirect "http://0.0.0.0"}
elseif { [class match [whereis $real_ip country] equals BlockedCountry]} {
HTTP::redirect "http://myforbiddenpage.com"}
}
else {
pool $default_pool}
}
}
}
- Icemanii_116694Jan 08, 2014NimbostratusI've tried using the foreach, but I'm hitting Connection closed by remote server when using the opera mini browser trying to access my server.