Allowing Cloudflare IP addresses only in Nginx

Tutorials / Tools

2020.11.18

Allowing Cloudflare IP addresses only in Nginx

If your HTTP server is running behind Cloudflare, it is recommended to only allow traffic from Cloudflare IP addresses. We can configure this systematically using iptables. However, it's also flexible to white list Cloudflare IPs just inside the Nginx service.

Automatically purge Cloudflare cache after Netlify build

Tutorials / Web Notes

2020.05.15

Automatically purge Cloudflare cache after Netlify build

Although Netlify provides CDN service, Cloudflare has more edge locations around the world. What's more, Netlify hosted sites are hardly reached in China, while Cloudflare still lives. With this in mind, I decided to switch to Cloudflare for load balancing. However, pushing post/file changes to Netlify did not clear Cloudflare's cache, that's a mess. So, I'm going to use Cloudflare's API together with Netlify's outgoing webhook to make them in the same pace.

Ads by Google
Ads by Google