Skip to content

This plugin is an implementation of a ip2region instance as a middleware plugin for Traefik.

License

Notifications You must be signed in to change notification settings

jeessy2/traefik-ip2region

Repository files navigation

  • download ip2region.xdb

    wget https://github.com/lionsoul2014/ip2region/raw/master/data/ip2region.xdb
  • config

      # Static configuration
      experimental:
        plugins:
          example:
            moduleName: github.com/jeessy2/traefik-ip2region
            version: v0.0.7
    http:
      middlewares:
        my-plugins:
          plugin:
            traefik-ip2region:
              dbPath: /plugins-local/config/ip2region.xdb
              headers:
                country: "X-Ip2region-City"
                province: "X-Ip2region-Province"
                city: "X-Ip2region-City"
                isp: "X-Ip2region-Isp"
              ban:
                enabled: false
                country:
                #  - 
                province:
                #  - 
                city:
                #  -
                userAgent:
                #  - 
              whitelist:
                enabled: false
                country:
                #  - 
                province:
                #  - 
                city:
                #  -
                userAgent:
                #  - 
    
  • k8s

apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: traefik-ip2region
spec:
  plugin:
    traefik-ip2region:
      dbPath: /plugins-local/config/ip2region.xdb
      ban:
        enabled: false
      whitelist:
        enabled: true
        country:
          - 中国

About

This plugin is an implementation of a ip2region instance as a middleware plugin for Traefik.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published