Content Delivery Networks are a great mechanism that you can use to serve up content very quickly and easily across multiple mediums as well as handle security certificates for you.

We suggest CloudFlare, Fastly, or KeyCDN when using Content Delivery Networks with SendGrid.

Using CloudFlare

The following instructions assume you already have a CloudFlare account made, using either a Full DNS setup or a CNAME setup. You can compare the two different setups here. Note that a CNAME setup is only available to Business or Enterprise level CloudFlare plans.

The instructions also assume that you have set up a valid email links whitelabel on your account. This step is essential for the following instructions to work.

Begin by logging into your CloudFlare account, and navigating to the DNS settings for your domain.

CloudFlare DNS Settings

Add a new CNAME entry that points your configured Email Links WhiteLabel domain to sendgrid.net.

CloudFlare DNS Addition

Once the record is created, click on the cloud icon under the Status column to turn it orange and enable HTTP proxy.

CloudFlare DNS HTTP proxy

Next, navigate to the Page Rules settings for your domain. You will need to create a Page Rule for your Email Links Whitelabel domain that sets SSL to Full. This is necessary due to how CloudFlare validates the certificate on the origin. You can find more information on the different SSL options here.

CloudFlare Page Rules Addition

Ensure that the Page Rule is On.

CloudFlare Page Rules Verification

If you are using a CNAME setup, you will also need to change DNS to point to the CloudFlare CNAME you created.

Once all of this is done, you will need to contact SendGrid support and request that SSL click and open tracking be enabled on your account. They will then verify the configuration and enable the setting on your account.

Using Fastly

  1. Sign up for Fastly or log in to an existing account.
  2. Click Configure on the Dashboard.
  3. Click the gear icon to open the Manage Service menu and click Create.

Set the options as follows:

  • Server address and port: sendgrid.net : 443 The connection on the SSL port 443
  • Domain: email.example.com Enter your links whitelabel domain here. Ensure it matches the domain configured in the SendGrid whitelabel settings. This value will be what recipients see in your SSL enabled click tracking links.
  • Description: SendGrid (or whatever you like)

Finally, click the Create. The new service will appear in the list of available services.

Contact SendGrid support to validate your CDN settings and enable SSL click and open tracking.

For more information, please visit Fastly’s documentation.

Using KeyCDN

This section is maintained by KeyCDN, if you have any questions about KeyCDN please contact their support team.

Sign up for KeyCDN or login to your existing account.

Create a pull zone and point the origin URL to https://sendgrid.net.

KeyCDN Pull Zone

Enable SSL and HTTP/2 (custom SSL or Let’s Encrypt).

KeyCDN Enable SSL

Enable the option “Forward Host Header.”

KeyCDN Forward Host Header

Add the Zonealias (with the alias you want to use for your email links whitelabel domain)

KeyCDN Zonealias

Finally, contact SendGrid support, and they’ll validate the CDN settings and enable SSL click and open tracking.