Automatically block direct IP's

Hello, I’m currently using caddy v2 reverse proxy with Cloudflare, Is there a way to block/ban all direct IPs trying to connect to my VPS directly? Since everyone connected thru Cloudflare IP. Just want to ban all the IPs from DDOS Attacks.

You can use the remote_ip matcher (with not to invert the match) and abort any request coming from anything other than Cloudflare’s CIDR ranges

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.