Set up using object URL
In the MEGA website
- Select the bucket with the objects that you want to serve with the CDN.
- Right-click the bucket.
- Click Settings.
- Click Object URL access.
- Select Grant object URL access to the bucket.
- Click Update.
- Open the bucket.
- Right-click an object you want to serve with the CDN, and click Manage object URL.
- Click Copy.
In the BunnyCDN dashboard
- Click CDN on the left-hand panel.
- Click + Add Pull Zone.
- Enter a name for your pull zone.
- In the Origin URL field, paste the object URL and delete the name of the object so that it looks like this
https://s3.g.s4.mega.io/[ID]/[BucketName]
. - Finish the configuration by selecting the rest of the options as you prefer, they will not affect S4.
- Click Add Pull Zone.
Now you can use the link https://[PullZoneURL]/[ObjectName]
. The object will be displayed or downloaded the same way as in the object URL.
Set up using the S4 API
In the BunnyCDN dashboard
- Click CDN on the left-hand panel.
- Click + Add Pull Zone.
- Enter a name for your pull zone.
- In the Origin URL field, enter the endpoint address you want to use and the name of the bucket you want to serve. Example:
s3.g.mega.io/[BucketName]
- Finish the configuration by selecting the rest of the options as you prefer, they will not affect S4.
- Click Add Pull Zone.
- Click your pull zone to go to its options.
- Click Security then S3 Authentication.
- Click to toggle on Enable AWS S3 Authentication.
- Enter the following information:
- AWS Key: Your Access key.
- AWS Secret: Your Secret key.
- AWS Region Name: Enter your chosen endpoint address.
- Click Save AWS configuration.
Now you can use the link https://[PullZoneURL]/[ObjectName]
. The object will be displayed or downloaded the same way as in the object URL.