1) Providing Geolocation Data
To provide this data, you can benefit from MaxMind, IpGeolocation services. These services allow you to download databases containing IP and city information. In this step, we will explain how to use it by downloading the free GeoLite2 City database offered by MaxMind. Apinizer usually uses client IP address to obtain geolocation data. The incoming IP address is queried through a database to determine which city the request comes from. After completing the registration process on the page, we go to the red marked area specified below and download the zip file in the GeoLite2 City section and extract it to obtain our .mmdb extension file:
2) Integration of Geolocation Database to Apinizer
.mmdb extension file is added here and deployed from Administration → System Settings → IP Geolocation Setting page.
3) Activating XFF and Adding Allowed/Blocked IP List Policy
Through Apinizer, the real IP address of the client can be determined in requests using X-Forwarded-For (XFF) header information. With Allowed IP policy, permission can be given to requests coming from specific IP addresses or specific cities. Using Blocked IP policy, these requests can be blocked. To use XFF information, you can activate it from Settings tab through Proxy settings:


4) Access Blocking and Result
Access was blocked in a request made to the service with an IP address from Istanbul location:
- We explained how we blocked requests coming from Istanbul on Apinizer platform.
- We downloaded the GeoLite2 City database offered by MaxMind and integrated this data into Apinizer.
- We controlled requests coming from specific cities by determining the real IP addresses of clients with X-Forwarded-For (XFF) header information.
- We selected Istanbul using Block Ip List policies to block requests coming from Istanbul and successfully blocked access from this city.

