Use the following statements in your conf files. IPs are in CIDR format. Replace with your IP ranges as needed.
Apache 2.4
<FilesMatch ".*">
Require ip 192.88.134.0/23
Require ip 185.93.228.0/22
Require ip 2a02:fe80::/29
Require ip 66.248.200.0/22
Require ip 208.109.0.0/22
</FilesMatch>
Apache 2.2
<FilesMatch ".*">
Order deny,allow
Deny from all
Allow from 192.88.134.0/23
Allow from 185.93.228.0/22
Allow from 2a02:fe80::/29
Allow from 66.248.200.0/22
Allow from 208.109.0.0/22
</FilesMatch>
nginx
location / {
allow 192.88.134.0/23;
allow 185.93.228.0/22;
allow 2a02:fe80::/29;
allow 66.248.200.0/22;
allow 208.109.0.0/22;
deny all;
# Existing NGINX rules
}