

- Backblaze cloudflare how to#
- Backblaze cloudflare update#
- Backblaze cloudflare code#
- Backblaze cloudflare download#
- Backblaze cloudflare free#
(Once Cloudflare's recently announced Workers KV comes out of beta, we will update this article to store the authorization key in this distributed database.)
Backblaze cloudflare code#
Backblaze cloudflare download#
The procedure here uses a Python script and the B2 APIs to get a new B2 download authorization, good for 7 days from the moment the script runs. Fortunately, both Backblaze B2 and Cloudflare offer APIs that can automate the process.

Manually updating the authorization each week would be a chore: this is something that should happen automatically. Although an authorization is good for any number of requests, B2 authorizations eventually expire (the longest period of time an authorization can persist is 7 days). One solution is to use a Web Worker to rewrite the request URLs on the fly, adding an Authorization parameter. Web Workers, Updates, and Authorizations: Working Together
Backblaze cloudflare free#
At the free level, only one script is possible, but one is enough to allow Cloudflare access to otherwise private data. Web workers are available at all plan levels (including the free plan), for a nominal charge (please see Cloudflare's site for their pricing and plan). Even better, Cloudflare's web workers can be uploaded directly into Cloudflare's servers making the automation of the process straightforward. These make it straightforward to add authentication headers to content requests, and authenticate the link between Cloudflare and Backblaze B2. Web Workers for the WinĬloudflare offers web workers, small Javascript snippets that allow rewriting HTTP and HTTPS requests on the fly. Fronting a website through Cloudflare is slightly more complex: now Cloudflare has to access private buckets to retrieve and cache data, which means Cloudflare has to authenticate its requests to Backblaze B2. When hosting a website directly, adding the authentication required to pull data from Backblaze B2 is straightforward. Putting these elements together means that customers serving data from their website want to serve from their website they want to store their photos and videos and all of their digital content in a private bucket, available through (and only through) their website. Backblaze's various integration partners have incorporated this security into their tools to keep Backblaze B2 as user-friendly as possible while still maintaining security. By default, Backblaze B2 storage is private, which means that access requires authentication. Behind the scenes, Cloudflare allows a website's domain to be aliased to some other domain, so that a user may see images and content from when those images and that content is actually being served from Backblaze B2 ( ) Backblaze Buckets are on the Internet SecurelyĪlthough all buckets are addressable from the internet, only public buckets can be accessed by just anybody. A website's domain name is registered with Cloudflare (and transferred from its domain name registrar), so that Cloudflare becomes responsible for serving content from that domain. Through caching and private high-speed links, Cloudflare ensures high availability and reliability from storage. How does a CDN like Cloudflare work?Ĭloudflare leverages DNS ( Domain Name System) so that content requests come to Cloudflare's servers. One solution to ensuring performance and availability is to route requests through a CDN ( Content Delivery Network) such as Backblaze's Bandwidth Alliance partner Cloudflare, taking advantage of Cloudflare's performance and the free data transfer between Backblaze B2 and Cloudflare. Many customers have expressed interest in hosting static data for their website (ranging from minified Javascript applications to multi-hour 8K video) because of the security, reliability, and affordability of Backblaze B2 storage.

If you would like to allow Cloudflare to fetch content from a public Backblaze B2 Bucket, see the KB article on using Cloudflare Workers to fetch content from a public B2 Bucket.
Backblaze cloudflare how to#
This article explains how to use Cloudflare Workers to serve data from a private B2 Bucket.
