Example configuration:
syntax:*geo [$ip_variable] $variable { … }*
default: none
The directive describes the dependency of the value of a variable on the IP-address of a client. By default, the IP-address used for the lookup is $remote_addr, but since version 0.7.27 it is possible to specify which variable should be used.
Addresses are assigned in the form CIDR. Furthermore, there are four special parameters:
Example of the description:
- delete – deletes the specified network (0.7.23).
- default - the value of variable, if the client address does not correspond to any assigned address. It is possible so to write instead of default 0.0.0.0/0.
- include - text file with addresses and values information. Several files can be inluded like this.
- ranges – specifies that the addresses specified are in the form of ranges (0.7.23). This directive must be the first.
The value will be the the one with maximum agreement. For example, the IP address 127.0.0.1 will get the value "ru", but not "us".
Example with ranges: