This script is a copy of https://marekbosman.com/site/automatic-update-of-cloudflare-ip-addresses-in-nginx/
wget https://gist.githubusercontent.com/AidasK/27aa5d6f918eca12d95427178b5aaa59/raw/e3ce185de43d89c237e081d3f56e5a79024b4115/cloudflare-update-ip-ranges.sh -P /usr/local/bin/
chmod +x /usr/local/bin/cloudflare-update-ip-ranges.sh
add include /etc/nginx/cloudflare;
this line to /etc/nginx/nginx.conf (above include /etc/nginx/conf.d/*.conf;
)
crontab -e
0 4 * * sun /usr/local/bin/cloudflare-update-ip-ranges.sh
For CentOS 7, there are packages with those lists, which can be updated via
yum update
.