Set Up a CDN Distribution with IONOS Object Storage as the origin

Introduction

A CDN is a network of distributed servers that can efficiently deliver web content to users across different geographic locations. This tutorial will guide you through the process of setting up a Content Delivery Network (CDN) distribution for a domain using IONOS Cloud and it uses the domain example.com for demonstration purposes.

Overview

This tutorial demonstrates the use of the following:

Components

Description

Cloud DNS

IONOS Cloud DNS lets you publish Domain Name System (DNS) zones of your domains and subdomains on public Name Servers.

Certificate Manager

IONOS Certificate Manager is a tool that simplifies the management of Secure Sockets Layer/Transport Layer Security (SSL/TLS) certificates for websites and applications.

IONOS Object Storage

IONOS Object Storage is fully compatible with S3, so you can manage buckets and objects with existing S3 clients when correctly configured.

CDN

IONOS Content Delivery Network.

Overview

Before you begin

To set up a CDN distribution using IONOS Cloud, it is mandatory to have a domain name. Example: test.example.com.

Execution

The execution process is divided into the following steps:

  1. Create a Zone

  2. Create an Auto-Certificate

  3. Set up a User-owned bucket

  4. Create a CDN Distribution

  5. Point Zone Records to CDN

  6. Verify the Result

1. Create a Zone

To create a zone, follow these steps:

1. In the DCD, go to Menu > Network Services > Cloud DNS > Public zones tab.

2. Select Create primary DNS Zone and enter the following information:

Component

Description

Example

Enabled/Disabled

Your zone is by default Enabled.

Name

Your desired domain/subdomain.

test.example.com

Description

A description of the zone.

My CDN distribution zone

3. Click Create zone.

Create primary Zone

The success message includes an option to copy the IONOS nameservers, which you can use to configure your domain at your registrar. Please note that DNS changes may take up to 48 hours to propagate and be effective. Verify that your nameservers in your domain registrar are correctly pointing to:

  • ns-ic.ui-dns.com

  • ns-ic.ui-dns.de

  • ns-ic.ui-dns.org

  • ns-ic.ui-dns.biz

Zone successfully created

2. Create an Auto Certificate

Note: Before creating an Auto certfificate, ensure you create ACME provider.

ACME Provider

To create an Auto Certificate, follow these steps:

1. In the DCD, go to Menu > Security > Certificate Manager.

2. Click Create Certificate and select Auto Certificate.

3. Enter the following information:

Section

Component

Description

Example

Certificate Provider

Provider

Your ACME provider.

Let's Encrypt

Properties

Certificate Name

Unique identifier for the certificate.

test.example.com

Common Name

Common name for the certificate.

*.example.com

Key Algorithm

RSA algorithm type. RSA is used for secure public-key encryption and digital signatures.

RSA3072

Subject Alternative Names

(Optional) Add up to 10 names for the certificate.

Auto-Certificate Properties

4. Click Create to create the Auto Certificate.

3. Set up a User-owned bucket

To set up a user-owned bucket, follow these steps:

Prerequisite: You must have at least one active access key; otherwise, Generate a Key or activate an existing one.

1. In the DCD, go to Menu > Storage & Backup > IONOS Object Storage.

2. In the Buckets tab, click Create a bucket.

3. Choose the Bucket region which determines the geographical location where the data inside the buckets will be stored.

Create a Bucket

4. Enter a unique Bucket name that adheres to the naming conventions for a bucket.

Note: The Bucket name must match the fully qualified domain name. Example: test.example.com.

Create a Bucket

5. Click Create bucket.

Note: A bucket will not be created if a bucket with the same name already exists in the IONOS Object Storage.

6. Go to Bucket Settings > Public access > Static Website Hosting, specify your index and error documents and click Enable.

Enable Static Website Hosting

7. Upload your website files to the bucket. Example: index.html or .png.

Upload your website files

Info: You can create a website using the IONOS Cloud AI Model Hub Text Generation feature.

4. Create a CDN Distribution

Prerequisite: Ensure you have the corresponding permissions to create and manage CDN distributions. Only contract administrators, owners, and users with Access and manage CDN privilege can create a CDN distribution. For more information, see Set User Privileges.

1. In the DCD, go to Menu > Network Services > CDN.

2. Click Create CDN distribution from the Distribution overview page.

3. Define distribution properties :

Component

Description

Example

Domain

Enter your domain.

test.example.com

SSL Certificate

Enter the name of certificate you created using Certificate Manager.

example-ssl-certificate

Distribution properties

4. Define routing rules:

Component

Description

Example

Prefix

Enter a prefix that helps the CDN determine the routing policies to apply for any URL path starting with the specified prefix.

/

Scheme

Choose the transfer protocol type (HTTP/HTTPS, HTTPS, or HTTP). The CDN directs HTTP requests to HTTP and HTTPS requests to HTTPS.

HTTP/HTTPS

Host

Enter the website host of the IONOS Object Storage.

s3-website-eu-south-2.example.com

Caching

Turn on or off caching for responses from the upstream host. When enabled, content is cached and reused for subsequent requests.

On

WAF

Turn on or off the Web Application Firewall (WAF) to protect the upstream host from threats and vulnerabilities.

On

Rate Limit Class

Choose a rate limit class from the following to control the rate of incoming requests from specific IP addresses: R1, R5, R10, R25, R50, R100, R250, R500.

R10

SNI Mode

For the usage of Object Storage you will need to use origin mode instead of distribution mode.

origin

Geo Restrictions

Click Open country list to turn on or off countries to be blocked or allowed, then click Save. You can also enter a letter to navigate to the country code and choose to block or allow.

Allowed countries: DE , FR ,ES

Routing Rules

6. Click Save to apply the CDN distribution configurations.

5. Point zone records to CDN

1. In the DCD, go to Menu > Network Services > CDN.

2. In the Distribution overview, select the created CDN distribution.

3. In the Details & Edit CDN distribution, copy the following IP addresses needed to configure the domain's DNS settings so that the CDN functionality can be active:

  • IPv4 address

  • IPv6 address

4. Create two new records in your DNS zone pointing respectively to the IPv4 and IPv6 addresses.

Info: As the tutorial demonstrates the use of Cloud DNS, we are creating the following:

  • domain or subdomain of type A pointing to the IPv4 address.

  • domain or subdomain of type AAAA pointing to the IPv6 address.

To create a record, follow these steps:

1. In the DCD, go to Menu > Network Services > Cloud DNS > Public zones tab.

2. Select the appropriate zone in the DNS ZONES column to create records. Alternatively, click Details & Records in the ACTIONS column. 3. Click Create Record in the Details & Records window. 4. Enter the following details in the Create Record window:

Component

Description

Example

Enabled/Disabled

Set the DNS record to either Enabled (default) or Disabled.

Enabled

Name

Enter a name for your DNS record. Leave empty for an Apex record. Use * for a wildcard record.

test

TTL

Set the Time-To-Live in seconds. The default is 3600 seconds.

60

Type

Choose from available DNS record types.

A

Content

Enter the content for the DNS record, typically an IPv4 address or relevant data depending on the record type.

192.0.2.1

Create Type A Record

5. Click Save to create the DNS record.

Validate the Zone Records

Verify that the A and AAAA records for your zone are correctly set up:

dig example.com A

The output should display the correct IP addresses for your zone.

6. Verify the Result

Conclusion

In this tutorial, you have successfully set up a CDN distribution for your domain using IONOS Cloud. Your website should now be accessible via the CDN, and you can enjoy improved performance and availability.

Last updated

Was this helpful?