Bunny CDN

Bunny CDN is a content delivery network that works well with Storj, providing a caching layer beyond Storj's already reliable global performance. Storj is great for distributing files around the world, but for some workloads a Content Delivery Network combined with Storj is the more appropriate choice. CDNs leverage distributed caching to reduce latency and enhance website performance from servers located closer to the end-users.

The following directions show how to set up static website hosting with Storj and Bunny CDN.

Create a publicly shared bucket / prefix in Storj

To work with Bunny CDN, you'll first need to share a bucket or prefix (folder) in Storj.

This can be done by following Part 1 of our Static site hosting directions, or using the Storj.io's Object Browser.

If using our CLI tool, record the storj-root and storj-access values from the Static site hosting directions.

If using the Storj.io website, you'll need to determine the storj-root and storj-access values from the Shared Link. Visit the Shared Link in a browser, and copy the new, resulting URL. This URL will follow a known formula: https://link.storjshare.io/s/ + storj-access + / + storj-root.

In the example of https://link.storjshare.io/s/jwm2j2juznpzcyl5kzgxzxvareoq/mybucket/myfolder/, record storj-root:jwm2j2juznpzcyl5kzgxzxvareoq and storj-access:/mybucket/myfolder/

The storj-root part of a Shared Link URL is "URL-encoded." URL-encoded values often have slash characters ('/') replaced with %2F. Visiting the URL in a browser is a convenient fix in most circumstances.

Configure Bunny CDN

  1. Log into Bunny.

  2. Click CDN of the left hand menu.

  3. Click Add Pull Zone in the upper right.

  4. Enter any name in the Pull Zone Name section. Record the full domain name (EG: example.b-cdn.net) for later use.

  5. Set Origin URL to http://link.storjshare.io/

  6. Set Host Header to the URL to the desired final hostname (EG: www.example.test).

  7. Chose your tier and pricing zones.

  8. Click Add Pull Zone

Configure Your Domain Registrar

  1. In your DNS provider, create a CNAME record on your hostname corresponding to your Bunny domain created above (EG: example.b-cdn.net).

Ensure you include the trailing . at the end of your CNAME if your DNS providers allows.

  1. Create two TXT records, prepending txt- to your hostname. Set them equal to your storj-root and storj-access values.

Root Path: the bucket or object prefix key that you want your root domain to resolve to (and that contains your index.html file).

Access Key: the readonly and public access key to your root path.

  1. You can check to make sure your DNS records are ready with dig @1.1.1.1 txt-<hostname>.<domain> TXT

  2. Optionally, if you create a page titled 404.htmlin the root of your shared prefix, it will be served in 404 conditions.

  3. That's it! You should be all set to access your website! e.g.http://www.example.test

<<<<<<< Updated upstream =======

Stashed changes

Previous
Bacula