S3 files on a Custom Domain with SSL?

Has anyone found a way to serve S3 files on a custom domain with SSL?

I have a CNAME record setup that works currently, but only serves over http, even though my Bubble domain is setup on https on cloudflare.

The way I have it setup, my S3 bucket name is: “bucket.domain.com
Then I have the CNAME record: “bucket.domain.com” pointing to “s3.us-east…”

The file serves over https with the normal “s3.us-east…” url, but when using the CNAME “bucket.domain.com” I drop https and get a security warning.

Edit: For additional context, the end goal is to deliver a video to TikTok on my root domain (ie. bucket.domain.com/video.mp4) Because TikTok only accepts API uploads from the root domain.

Just curious where you saw this in their docs? I couldn’t find anything cause it sounded like an odd requirement of theirs. All I see is you provide a publicly accessible file UR, or alternatively PUT the video file directly to them.

" * Ensure that the media URL you provided belongs to a path that you own. To confirm ownership, log into the TikTok for Developers website and add your Domain or URL Prefix property to your application in the URL properties widget as shown below. You must have manage or write access to the property."

I did end up finding a solution for anyone who wants to serve S3 files (or any files for that matter) on a custom domain over HTTPS.

I setup CloudFront with an origin pointing to the S3 bucket, and then added a CNAME in my DNS provider that points to CloudFront. I also had to create a SSL certificate using Amazon’s free certificate provider. Now I get all my files hosted at “bucket.domain.com/filename” instead of “s3.us-east…”.


How did you end up setting up CloudFront?

I haven’t done it but I’m pretty sure you do everything above through your AWS console. You would make your own AWS account and in @creatorbee 's situation it was files stored on their own S3 bucket. Not sure how it would work storing them on Bubble

Is there a way to set up your website to use your own S3 rather than Bubble’s S3 when saving data?

Yea I use a plugin to upload to Wasabi S3. It’s not a direct swap though where everything in Bubble automatically knows to go there instead. Like you use the plugin’s file uploader element instead of the native Bubble one

1 Like

Does wasabi have a consistent domain that could be verified by tiktok? Or would I have to set up cloud front and ssl still? Sorry if this seems obvious im just not too familiar with cloud as of now.

I think CloudFront still but you just point to Wasabi instead? :sweat_smile:

1 Like