R2 S3 API Custom Domain

Is there a way to point a Custom Domain at my R2 bucket for access through the S3 API?
6 Replies
Hello, I’m Allie!
There is not
Conner
ConnerOP2mo ago
@HardlyWorkin' can I do it through proxy or dns? Or does R2 block that somehow
Chaika
Chaika2mo ago
It wouldn't work because 1. You can't proxied CNAME to a different account in Cloudflare 2. You can't override the host header if non-ent, so will always not work (also wouldn't work unproxied for the same reasons) 3. Even if you somehow got through those, with Cloudflare on free plan you have restrictions on max upload size (100mb on free/pro, 200 mb on biz, 500 mb on ent, 5 gb on special s3 endpoint) 4. Even if you got around that/used an external proxy, you'd still have extra latency/other issues. A quick search shows for example presigned urls include the full url including the hostname which obviously wouldn't work with a blind proxy Edit: It looks like actually even with just normal sigV4 the host header and entire uri is signed: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html so wouldn't work at all in any client without modification looks like. something R2 would have to specifically support Just a bad idea generally. You could maybe get it to work if you pointed it at your own server/worker and had your own logic to handle rewriting the request/resigning, would run into upload size limits if on CF tho
Conner
ConnerOP2mo ago
@Chaika Wow that's an L. Alright thanks for the info @Chaika Wait to be clear this is only for uploads. Not for presigned urls. Not sure if that makes it possible This would be with an authentication key. From another server. Goal is to give a client and easy to use url
Chaika
Chaika2mo ago
Either proxy them through a worker using the worker binding if less then 100 mb or use a worker to gen presigned urls to return to your client (or you could use a server proxying the uploads or a server generating presigned urls instead of workers, same concept)
Conner
ConnerOP2mo ago
Goal was to use S3 api as an easy to user standardized API but kk we can use workers still ofc
Want results from more Discord servers?
Add your server