An iptables script that allows your HTTP(80)/HTTPS(443) port to only receive traffic from cloudflare.
For users whose HTTP server is directly exposed to host 80/443:
$ git clone https://github.com/kingcc/cloudflare-ips-only.git
$ cd cloudflare-ips-only
$ sudo bash ./host.sh
For users deployed with docker on server:
$ git clone https://github.com/kingcc/cloudflare-ips-only.git
$ cd cloudflare-ips-only
$ sudo bash ./docker.sh
MIT