Hello, I am trying to build a picture bed for my blog. The solution I use is Backblaze B2 cloud storage + Cloudflare CDN.
First, I set up a CNAME resolution to resolve one of my second-level domain names “img” to the server address given to me by Backblaze, so that when I visit
Will jump to
to get files.
But I found that the file link provided to me by Backblaze directly contains the name of my bucket. so that even if I use the CNAME URL through Cloudflare’s proxy service, other people can still get the real address of the file.
So I tried to use URL Rewrite in Transform Rules to modify the address.
my goal is change this link
to hide the bucket name.
But after I modified it,
Error 1035 Invalid request rewrite appeared
Can anyone know if something went wrong with me?
Below are the rules I used
(http.request.full_uri contains "img.example.com/" and not http.request.full_uri contains "/file/my-bucket-name")
Dynamic rewrite to
I have tried to search for errors in the forum and read the instructions but I have not found an answer that helps me.
Below is the address of the article that I have read and may be helpful to you
https://blog.cloudflare.com/introducing-transform-rules-with-url-rewriting-at-the-edge/ https://developers.cloudflare.com/firewall/cf-firewall-language/fields https://developers.cloudflare.com/firewall/cf-firewall-language/functions
English is not my native language, so there may be some small mistakes. I’m sorry for that. If you don’t understand what I’m talking about, please feel free to ask, thank you!