Hi, I'm trying to combine a middleware/plugin for Cloudflare to pass real client IPs to services behind Traefik (GitHub: BetterCorp/cloudflarewarp) with a middleware for filtering allowed IPs (whitelist). Each middleware works fine on its own, but when I use them together, the Cloudflare plugin fails to pass the real client IP to the whitelist middleware. I've tried using middleware chains, but it hasn't helped.
Currently, my middleware configuration looks like this:
/data/custom/cloudflare.yml
http:
middlewares:
my-cloudflarewarp:
plugin:
cloudflarewarp:
disableDefault: false
/data/custom/whips.yml
http:
middlewares:
whitelist:
ipWhiteList:
sourceRange:
- "192.168.1.0/24"
- "1.2.3.4/32"
- "4.5.6.7/32"
- "3.4.5.6/32"
/cf-whips-chain.yml
http:
middlewares:
cf-then-whitelist:
chain:
middlewares:
- my-cloudflarewarp@file
- whitelist@file
and service I want to make to work /data/custom/bnb.yml
http:
routers:
bnb:
rule: "Host(`bnb.hostname.ru`)"
service: bnb-web-service
middlewares:
- cf-then-whitelist@file
services:
bnb-web-service:
loadBalancer:
servers:
- url: http://192.168.1.33:88