R2 as static files server


We’re using Django + sjango-storages and, the workflow we imagine with R2 is:

  • Upload static-files with manage.py collectstatic (works with boto3)
  • Point a subdomain at the bucket; set CORS settings (this doesn’t seem to have a way to do)
  • Voila! Static files are now available at static.mydomain.io.

Is this workflow currently supported?


1 Like

If you deploy a Worker in front of your R2 bucket, then yes it should be!

Buckets can’t be public themselves directly today without a Worker in front, but if you throw something like this in front of your bucket, I believe this should fit your use case.


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.