I’m following a tutorial from Backblaze to front my B2 bucket through a Cloudflare Worker as a CDN. They verified I have followed all the steps correctly but any files I try to access result in a “SignatureDoesNotMatch” error. Backblaze helped as much as they were able to but eventually had to direct me to Cloudflare for further support. I’m using the following guide: https://www.backblaze.com/docs/cloud-storage-deliver-private-backblaze-b2-content-through-cloudflare-cdn
Here are the steps I have performed:
- Created public Backblaze Bucket and accompanying Application Key
- Created Cloudflare Worker using Wrangler.
wrangler generate my-cdn https://github.com/backblaze-b2-samples/cloudflare-b2
cd my-cdn
nano wrangler.toml
Here I have set the appropriate environment variables pointing to my bucket, used $host
for the BUCKET_NAME
environment variable, true
for ALLOW_LIST_BUCKET
and then set the B2_APPLICATION_KEY
environment variable using secrets:
echo "<my b2 application key>" | wrangler secret put B2_APPLICATION_KEY
wrangler deploy
- I was able to check a known URL for a file in the bucket but replacing the backblaze domain with my *.workers.dev domain. This resulted in the “SignatureDoesNotMatch” error.
- I add a Custom Domain to the Worker in case that would make a difference. The domain being
media.example.com
. I check that, and also get the “SignatureDoesNotMatch” error here.
At this point Backblaze seem to be stumped, and direct me here for further assistance.