The instructions below have been customized for your project "".
Customize these instructions for the project
GeoIP database
redirection.io supports the creation of rules based on the value of request headers, which has been used for a long time to create rules based on the client's country, using the X-Country-Code header (or any other similar header), if it is set by a proxy or a CDN in front of the agent.
However, all hosting providers and CDNs do not set such headers, and even when they do, the values may not be accurate. To solve this issue, redirection.io has a built-in GeoIP database support, which allows you to create rules based on the client's country without relying on any header set by a proxy or a CDN.
By defining the http.geo_ip configuration in the agent configuration file, you can specify the path to a local GeoIP database file, and the agent will automatically use it to populate request headers that will be available for your rules and will be sent to the backend servers.
redirection.io does not enforce a specific GeoIP database, but it should be a file in the MaxMind DB format.
All GeoIP databases that are in the MaxMind DB format can be used with redirection.io, whatever the organization of the data they contain. For example, in the following example, the headers X-Geo-Country, X-Geo-City and X-Geo-Latitude will be populated with the values of the country.iso_code, city.names.en and location.latitude fields of the GeoIP database found at /path/to/geoip.mmdb.
instance:
name: 'My Instance'
reverse_proxy:
listen:
- 'tcp://0.0.0.0:80'
forward:
address: 'backend:8080'
agent:
project_key: my-project-key
http:
geo_ip:
path: /path/to/geoip.mmdb
headers:
X-Geo-Country: $.country.iso_code
X-Geo-City: $.city.names.en
X-Geo-Latitude: $.location.latitude
If a value is not found in the GeoIP database for a specific header, the agent will not set the header in the request. If the path of value (eg. country.iso_code) is not found in the GeoIP database, the agent will log a warning message, and it will not set the corresponding header in the request.