I am using Traefik as my reverse proxy on my Docker server. Since I am also using Cloudflare as my external reverse proxy, I want to ensure that my endpoints are only accessible by Cloudflare servers (https://www.cloudflare.com/ips/).
I have seen some posts suggesting the use of a middleware label, like this:
labels:
- "traefik.http.middlewares.test-ipwhitelist.ipwhitelist.sourcerange=127.0.0.1/32, 192.168.1.7"
However, I haven’t found any solutions that allow me to fetch IP ranges directly from Cloudflare’s text endpoints (such as https://www.cloudflare.com/ips-v4/). Alternatively, I am open to solutions that involve fetching IP ranges from a local file that I can update myself.
Can you provide a clear and effective solution for this? (if possible, by fetching directly from their endpoint)