I’m experiencing a weird bug related to caching with Cloudflare. I am serving static files through Nginx at the route https://example.com/static/*. This serving works as intended, even with Cloudflare caching enabled. However, for one specific file, https://example.com/static/js/subscriptions.js, I am continuously getting 521 errors. The entirety of my site is accessible to Cloudflare, EXCEPT for that singular route.
Things that ‘solve’ the problem:
- Turning on development mode
- Adding a custom page rule that sets “Cache Level” to “Bypass” for https://example.com/static/js/*
Things I’ve done to try to fix the problem:
- Whitelist Cloudflare IP’s on origin server
- Purge entire cache
- Ensuring file appears when autoindex in Nginx is on
- File perms are fine (644, www-data)
I’m not sure what steps I can take to fix this. If nothing else works, I suppose I’ll keep using a page route.