Forum Discussion
Country code as X- Header
We've noticed that the F5 seems to know the country of visitors (presumably based on some IP lookup). Is there any way to get the F5 to pass the country code (e.g. "US" for U.S.A. or "DE" for Germany) to the web application as, e.g., an X-Country request header?
3 Replies
- Kevin_Stewart
Employee
Take a look at the following wiki article on the whereis command:
https://devcentral.f5.com/wiki/iRules.whereis.ashx
All modern F5 BIG-IPs come loaded with a "Geo-IP" database, primarily used for GTM geo-loadbalancing functions, but that is also accessible using the above command.
- Marc_13733
Nimbostratus
Thanks, so all I would need to know is how to set an X-header based on this
variable.whereis country - Kevin_Stewart
Employee
The HTTP::header insert method will do that for you, and the name of the header is arbitrary. Example:
when HTTP_REQUEST { HTTP::header insert "X-Country" [whereis [IP::client_addr] country] }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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