nginx-i2c

command module
v0.0.0-...-b7cc281 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 1 Imported by: 0

README

CircleCI GoDoc Go Report Card

nginx-i2c

nginx-i2c generates IP to country mappings for use in ngx_http_geo_module using the CIDR format. It supports IPv4 and IPv6 subnets, with the option to only use IPv4 subnets for IPv4-only servers. The MaxMind GeoIP2 database is used and complemented with data from AFRINIC, APNIC, ARIN. LACNIC and RIPE.

Usage

Compile with go build .

Usage:
  nginx-i2c [flags]

Flags:
  -e, --exclude strings        countries whose subnets to exclude, cannot be used with --include
  -h, --help                   help for nginx-i2c
  -i, --include strings        countries whose subnets to include, cannot be used with --exclude
  -4, --ipv4-only              only include IPv4 ranges
  -l, --lower                  output country codes in lowercase
  -t, --maxmind-token string   token for use with MaxMind
  -o, --outfile string         specify output file path (default "./ip2country.conf")

MaxMind now requires an account to download the country database.

Use with ngx_http_geo_module. No default country is specified. Choose your own default country by adding the relevant setting before including ip2country.conf.

geo $country {
    default        JP;
    include        conf/ip2country.conf;
    # extra rules here
}

Under consideration

  • IP range output

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL