Forum Discussion
iRule Geo Targeting
Hi Kevin ,
We've finally got some production access time. We can get a rule working as expected when we do it without the x-forwarded for , ie the below :
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/geo" } { set state [class match -value [whereis [IP::client_addr] state] equals uk_regions] if {($state ne "")}{ switch $state { Angus { pool $region } Poole {HTTP::redirect "http://www.hotmail.com"} Leeds {HTTP::redirect "http://www.yahoo.com"} else {pool CMS-TEST-POOL} } } } }
When we try with the X-Forward for element it doesn't seem to detect correctly though. Anyway you can think of to log out the x-forwarded for IP to the local0 to if the real IP / state is being detected ?
Recent Discussions
Related Content
* 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