Cloudflare GeoBlock is a plugin to block traffic based on header Cf-Ipcountry that issued by Cloudflare.
You need to make sure that traefik is live behind Cloudfare, otherwise the plugin will return HTTP Code 403.
This plugin also will automatically copy the IP from Cf-Connecting-Ip header, so you can chain it with traefik IpWhitelist middleware (https://doc.traefik.io/traefik/middlewares/http/ipwhitelist/)
Static Configuration:
pilot:
token: xxxxx
experimental:
plugins:
example:
moduleName: github.com/moduit-engineering/cfgeoblock
version: v0.1.4
Dynamic Configuration:
# Dynamic configuration
http:
routers:
my-router:
rule: host(`demo.localhost`)
service: service-foo
entryPoints:
- web
middlewares:
- my-plugin
middlewares:
my-plugin:
plugin:
cfgeoblock:
whitelistCountry: ["ID", "SG"]
disabled: false #optional