Set up Cloudflare CDN for app's API server but with static content on S3

So for the backend of an app, the API server is hosted on my own server. The DNS of this API server goes through Cloudflare. Cloudflare is also the proxy for the API server. This is already operational nicely.

Now we are adding a feature to allow people to upload videos on the app. Obviously we prefer to store the videos on AWS S3.

How can I set up Cloudflare so that I can use the CDN for the content stored on S3? So when the API server returns the AWS URI of a video, that content is served via Cloudflare.

The uploads and downloads will go through your API server.
If doing a quick drawing, it will look to something like that:
Users <-> Cloudflare <-> API server <-> S3

Regarding caching, it’s also possible. To do it, I like to use page rules and set it to do
Cache Level: Cache Everything (on this content only)
(I use “signed URLs” for content retrieval so it’s still authenthicated requests but it can be cached and even made public)

By the way, AWS S3 is quite expensive but replaceable easily, if it’s something you consider, Wasabi is a good alternative I used on a few projects, it’s working well https://www.cloudflare.com/fr-fr/bandwidth-alliance/wasabi/

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