# Serve shared files from a CDN

**URL:** <https://help.nextcloud.com/t/serve-shared-files-from-a-cdn/152083>\
**Category:** ℹ️ Support\
**Created:** [December 18, 2022, 10:22am UTC](https://help.nextcloud.com/t/serve-shared-files-from-a-cdn/152083 "2022-12-18T10:22:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donnie](https://help.nextcloud.com/letter_avatar/donnie/32/6_22734026db12803ebb3e059622ac3534.png) [@Donnie](https://help.nextcloud.com/u/Donnie)\
**Post date:** [December 18, 2022, 10:22am UTC](https://help.nextcloud.com/t/serve-shared-files-from-a-cdn/152083/1 "2022-12-18T10:22:19Z")

</div>

Hello,

I’m looking for a CDN app or a solution to serve my shared files from a CDN url. (Direct link)

My NextCloud site is used worldwide, I need to have fast download speed everywhere.

Example:

Origin: [https://mysite.cloud/ID/download/video.mp4](https://mysite.cloud/ID/download/video.mp4)  
CDN: [https://cdn.mysite.cloud/ID/download/video.mp4](https://cdn.mysite.cloud/ID/download/video.mp4)

Is there a way to make this work with NGINX? Maybe with a custom app?

(Cloudflare doesn’t allow the caching of huge mp4 files, I need to use a real CDN)

Thank you.

---

<div class="post-metadata">

**Author:** ![bb77](https://help.nextcloud.com/letter_avatar/bb77/32/6_22734026db12803ebb3e059622ac3534.png) [@bb77](https://help.nextcloud.com/u/bb77)\
**Post date:** [December 18, 2022, 1:06pm UTC](https://help.nextcloud.com/t/serve-shared-files-from-a-cdn/152083/2 "2022-12-18T13:06:23Z")

</div>

> [@Donnie](#):
>
> I’m looking for a CDN app or a solution to serve my shared files from a CDN url. (Direct link). I need to have fast download speed everywhere.

Not sure if I understand you correctly, but just adding a cdn subdomain to your server isn’t going to help with faster download speeds. CDN stands for **C** ontent **D** elevery **Network**. So if you want to run your own CDN, which is possible, you gonna need several servers / VPSs in different regions of the world, which are able to cache and deliver your content. Here is an article about how something like this could be setup: [https://dev.to/megajakob/how-to-build-your-own-cdn-io1](https://dev.to/megajakob/how-to-build-your-own-cdn-io1)

> [@Donnie](#):
>
> (Cloudflare doesn’t allow the caching of huge mp4 files, I need to use a real CDN)

The Enterprise plan allows for 5GB.

If you’re not an “Enterprise,” it’s probably going to be tough. So you may want to reconsider whether you _really_ need this. If it is only “nice to have”, you probably want to let it be or use other services to serve these files, instead of using your own server. Otherwise, you either have to spend a lot of money (Enterprise plan), or you can spend a little less money, but instead of that you have to put a lot more effort into it (the tutorial above). Or maybe there are other CDN providers besides Cloudflare, which are cheaper and / or have higher limits for the caching in their lower tier plans, not sure about that.

Beside of all that, I am not sure how easy it would be, or if it is even possible to split the content from a Nextcloud instance, in order to serve only shared files via external CDNs. I am also not aware of any app that can help with that. Maybe a Nextcloud cluster spread over several regions world would be the better solution for this. However, you probably won’t find much detailed help for any of these topics in the forums, because this is not a use case that home or small business users usually encounter.

---

<div class="post-metadata">

**Author:** ![Donnie](https://help.nextcloud.com/letter_avatar/donnie/32/6_22734026db12803ebb3e059622ac3534.png) [@Donnie](https://help.nextcloud.com/u/Donnie)\
**Post date:** [December 18, 2022, 2:09pm UTC](https://help.nextcloud.com/t/serve-shared-files-from-a-cdn/152083/3 "2022-12-18T14:09:41Z")

</div>

> [@bb77](#):
>
> you gonna need several servers / VPSs in different regions of the world, which are able to cache and deliver your content.

[Bunny.net](http://Bunny.net) automatically cache the files worldwide, but you need to use their domain or a custom domain that point to their servers to serve the files.

> **[How to create your first Pull Zone](https://support.bunny.net/hc/en-us/articles/207790269-How-to-create-your-first-Pull-Zone)**
>
> To start using bunny.net CDN, you will first need to create a pull zone. A pull zone is the 'zone' that users will request content through, accelerating the loading speed of cached web assets.
> Upon...

It is easy to implement something like this on Wordpress but I can’t find anyone talking about this for Nexcloud. It is strange for a files storage software to not have any CDN support.

> [@bb77](#):
>
> The Enterprise plan allows for 5GB.

Way too expensive.

---

<div class="post-metadata">

**Author:** ![anon75456558](https://help.nextcloud.com/letter_avatar/anon75456558/32/6_22734026db12803ebb3e059622ac3534.png) [@anon75456558](https://help.nextcloud.com/u/anon75456558)\
**Post date:** [December 19, 2022, 5:33am UTC](https://help.nextcloud.com/t/serve-shared-files-from-a-cdn/152083/4 "2022-12-19T05:33:14Z")

</div>

Try asking the cdn directly. It has no direct connection to Nextcloud.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 14, 2024, 2:25pm UTC](https://help.nextcloud.com/t/serve-shared-files-from-a-cdn/152083/5 "2024-12-14T14:25:20Z")

</div>


