The main purpose for me is want to make use their WAF. The reason why i don’t use CF is because they have 100Mb upload limit which cannot be skipped and only using their WAF.
As I know HestiaCP have pre-configured to accept CF as server trusted proxy IP. May i know if ussing Bunny, what should I configure to make HestiaCP grab real IP, traffic..etc from bunnyCDN for my HestiaCP console/website/docker(installed seperately)?
Take the Cloudflare configuration file (/etc/nginx/conf.d/cloudflare.inc) as a base and create a new one for Bunny CDN IPs (/etc/nginx/conf.d/bunny.inc).
Also, change this:
real_ip_header CF-Connecting-IP;
to this:
real_ip_header X-Real-IP;
Edit /etc/nginx/nginx.conf and comment out the include pointing to cloudflare.inc and add an include for bunny.inc
# Cloudflare IPs
#include /etc/nginx/conf.d/cloudflare.inc;
# Bunny IPs
include /etc/nginx/conf.d/bunny.inc;
After that, restart nginx.
systemctl restart nginx
Notes:
1.- Keep in mind that, by default, you can only use one CDN to extract the real IP. If you want to use multiple CDNs, you need to recompile Nginx with the headers_more module and configure the .inc file differently. I made a script to get the IPs from Cloudflare, Bunny and Fastly and configure the inc file automatically, but, as I said, you must recompile Nginx first.
2.- You must create a script to update Bunny CDN IPs and populate the .inc file, as they change frequently. Just in case, Bunny IPv4 list and Bunny IPv6 list.
Thanks, so if I only use Bunny but do not use CF, then no need to recompile and just follow your instruction above to change to trust Bunny?
Actually, I am not going to use its CDN but only want to use their WAF service. But I think I need to point my server to their IP so it may make trusting required anyway? am I right?
o. Coz when I ask Bunny support, it says if using their shield WAF, have to use their CDN anyway. So you only use it for DNS means u are not using their WAF ?
Good morning, I initially only used Cloudflare, but in Spain we’re experiencing Cloudflare blocks on weekends from internet providers due to a court order from LaLiga, the Spanish football league.
Currently I use Cloudflare and Bunny, but I’m planning to switch everything to Bunny. Could you share the script for updating IPs and provide instructions?
Keep in mind that LaF**Liga also blocks other CDNs, not only Cloudflare.
My script covers CloudFlare, Bunny and Fastly and it uses the module headers_more, if you only plan to switch from Cloudflare to Bunny I should change the script to only cover Bunny and change the logic to not use headers_more, if I’ve time I’ll do it in a while and I’ll post it here.
The list must be parsed to get the right format but the script I posted is not to add them to an ipset, it is to create the conf for Nginx to get the real ip of the connections coming from Bunny.
If you’re only going to receive traffic on those ports from Bunny, then yes, you can whitelist Bunny’s IPs and configure your firewall to only allow inbound traffic on 80/443 from those Bunny IP addresses.
Just keep in mind that other services (for example webmail) won’t work if they’re accessed directly and you don’t add them to Bunny as well.
Both of them, Bunny will get the certificates to serve your site but you can also issue your own certificates hosted by Hestia so communication from Bunny and your server is secure. You shouldn’t do anything, it should work out of the box.