How do I set a private folder if using a custom domain?

In S3 it was possible to make some folders private, but in R2 it seems that if custom domain is enabled it will make all folders public.

How do I set a private folder if using a custom domain?

2 Likes

Cloudflare R2 does not natively support per-object access control. The entire bucket is either private or public.

You can use Cloudflare Workers + R2 bindings to control access with more granularity, but you would have to write the code yourself.

I also have the same problem, I want some paths private under the R2 bucket, and some public. Because we don’t want everything can be reached by our clients. But I can’t find a way to do it. I hope Cloudflare may add permission rules for object reaching…

1 Like