Transform via URL
I am trying to use transform via url (https://developers.cloudflare.com/images/transform-images/transform-via-url/) for the files which are in r2 but I keep getting this 403 error.
I have enabled the image transform feature also in the dashboard for the zone I am using.
This is the url i am trying to use https://develop.zeno-learning.com/cdn-cgi/image/width=10/https://pub-f1a959600df4440395ebee40b129ce13.r2.dev/018e1dc1-3241-7e36-9a2b-b780344bebd7_image.png
Can anyone provide guidance on resolving this issue.
Cloudflare Docs
Transform via URL · Cloudflare Image Optimization docs
You can convert and resize images by requesting them via a specially-formatted URL. This way you do not need to write any code, only change HTML …
4 Replies
You don't want to use the pub-r2.dev urls for production. They are rate limited and for testing only, you want to add an R2 Custom Domain instead
The underlying reason for that specific Forbidden is probably because you don't have resize from any origin enabled though, under Image -> Transformations -> select domain
but turning that on would allow anyone to resize any images from any origin/server on your dime. So setting up an R2 Custom Domain as a subdomain and then resizing off that would be recommended
Ya just checked that it was not enabled, thank you for your quick response @Chaika