A distribution serves the files on your origin, such as your web server at static.example.com,
from edge locations around the world, at an address of its own. You create it once, and the CDN
then fetches each file from your origin only when an edge location has no fresh copy.
To serve a bucket in E2E Object Storage, use Add to CDN on the bucket instead, which fills in the origin for you. See Serve a bucket through the CDN.
Before you begin
Section titled “Before you begin”- CDN is on for your account: Create CDN shows on Manage CDN Services. If Request CDN shows instead, see Request CDN.
- Your origin is reached by a domain name, such as
static.example.com. It can be a server at E2E or anywhere else, and it can belong to another E2E account. - Anyone can read the files you will serve from the origin, with no sign-in.
- Your origin serves HTTPS with a certificate that is valid for its domain name. Every new distribution starts with Origin Protocol Policy set to HTTPS only, so the CDN connects to your origin over HTTPS. If the origin’s certificate is not valid for its name, visitors get an HTTP 502 error. If your origin serves only HTTP, set Origin Protocol Policy to HTTP only once the distribution is created; see How the CDN connects to your origin.
- To serve files at your own domain name, such as
cdn.example.com, you have a certificate for it in SSL Certificates in MyAccount. See Serve files at your own domain name.
A project can have one distribution for each origin domain name. A distribution belongs to the project you create it in. Distributions show the same whether you have Delhi or Chennai selected.
Choose a CDN plan the first time
Section titled “Choose a CDN plan the first time”The first time you click Create CDN while your account has no CDN plan, Select CDN plan opens before the create form. You choose the plan once, for the whole account.
- In MyAccount, under Network, click CDN. Manage CDN Services opens.
- Click Create CDN. Select CDN plan opens.
- In Choose a Plan, pick a plan. The list shows each plan’s monthly price, with the 250 GB plan selected. Choose the plan whose monthly bandwidth is closest to what you expect to serve.
- Read the warning on the page, which says that:
- The plan’s price is billed each calendar month as the full cost, or deducted from infra credits on a prepaid account.
- The plan renews on the first day of every month until you change it.
- Bandwidth beyond the plan is charged per GB.
- The plan cannot be changed in the month it takes effect.
- A discount or coupon may not apply.
- Check I understand and want to create CDN with a selected CDN plan. Next is available once it is checked.
- Click Next. MyAccount saves the plan and opens Create CDN.
On a prepaid account without enough infra credits for the plan’s price, Next opens a low balance dialog. Buy more infra credits, or ask your MyAccount administrator to, and then click Next again. For prices, see E2E’s pricing page.
Once your account has a plan, Create CDN opens the create form directly. To change the plan later, see Change your CDN plan.
Fill in the origin
Section titled “Fill in the origin”On Manage CDN Services, click Create CDN. On the Create CDN page:
- In Origin Domain Name, enter the domain name of the server the CDN fetches your files from,
such as
static.example.com. Enter the name only, with nohttps://and no path. An IP address is refused when you create the distribution. - (Optional) In Origin path, enter a folder at the origin to serve from, such as
/static. Start it with/, and leave no/at the end. A path in another shape, such asstatic/, is refused when you create the distribution. The CDN adds the path in front of every file path it asks your origin for. Leave it empty to serve everything on the origin. - Check Origin ID. It fills in with the Origin Domain Name as you type one, and it is required. Keep it as it is filled in.
With Origin path set to /static, a visitor who asks for https://<distribution-url>/logo.png
gets the file at static.example.com/static/logo.png. If the file is not in that folder on your
origin, the visitor gets your origin’s not-found answer.
Origin Domain Name reads Origin/Domain name is required. when it is empty, and DNS name you have specified is not valid. when the value is not a domain name.
Choose the certificate
Section titled “Choose the certificate”SSL Certificate sets the address visitors use to reach your files:
- Default SSL Certificate (*.e2enetworks.net), selected to start, serves your files at the distribution’s own address, its Distribution URL. Visitors’ browsers must support TLSv1 or later. Take this one unless you need your own domain name.
- Custom Certificate (example.com) serves your files at your own domain name. See the next section.
(Optional) Serve files at your own domain name
Section titled “(Optional) Serve files at your own domain name”To serve files at a name of your own, such as cdn.example.com, the origin must be on the same
domain, such as origin.example.com, and you need a certificate for that domain in
SSL Certificates. A wildcard certificate such as *.example.com covers both names. The
certificate must be issued by a certificate authority that browsers trust; a certificate signed by
any other authority is refused when you create the distribution.
- Under SSL Certificate, choose Custom Certificate (example.com).
- In Domain Names(CNAMEs), enter the names visitors will use, such as
cdn.example.com, separated by commas or one on each line. - In Select Certificate, choose the certificate. If you do not have one yet, click Buy or Import SSL Certificate, which opens SSL Certificates in a new tab. Once it is there, choose it here.
Every name you list must be on the same domain as the origin. These messages tell you what to change:
- CNAMEs are required.: enter at least one name.
- Origin and CNAMEs should have the same domain name.: change the names, or the origin, so they share one domain.
- A message about the certificate’s Subject Alternative Name (SAN): the certificate does not cover
the origin domain name or a name you listed. With a wildcard certificate such as
*.example.com, the origin domain name and every name must end inexample.com. For the exact messages, see Origin and CNAMEs should have the same domain name.
Create the distribution
Section titled “Create the distribution”Click Create Distribution. It is available once the required fields are valid.
Manage CDN Services opens again with Your Distribution has been created successfully. It will take upto 30 minutes to deploy. Please wait.
A second distribution for the same origin domain name in the project is refused with Domain already exists for this user. See Domain already exists for this user.
The settings a new distribution starts with
Section titled “The settings a new distribution starts with”Every new distribution starts with these settings. You can change each one after it is created; see Change distribution settings.
| Setting | Starts at |
|---|---|
| Origin Protocol Policy | HTTPS only |
| Origin SSL Protocol | TLSv1.2 |
| Origin Response Timeout | 30 seconds |
| Origin Connection Timeout | 5 seconds |
| Viewer Protocol Policy | HTTPS Only |
| Allowed HTTP Method | GET, HEAD |
| Minimum TTL | 0 seconds |
| Maximum TTL | 3153000 seconds |
| Default TTL | 86400 seconds, one day |
| Supported HTTP Versions | HTTP/2, HTTP/1.1, HTTP/1.0 |
| Default Root object | None |
Check that the distribution is live
Section titled “Check that the distribution is live”On Manage CDN Services, your distribution shows InProgress and Disabled while it deploys to the edge locations. This takes up to 30 minutes, and the page can show the change up to 15 minutes after that. When it shows Deployed and Enabled, it is serving files.
With the default certificate, copy the address under Distribution URL. It is the first part of your origin domain name, followed by 10 random letters and digits. Then ask for a file through it:
curl -I https://<distribution-url>/<file-path>Replace <distribution-url> with the address you copied, and <file-path> with a file’s path on
your origin. The status 200 on the first line of the output means the CDN served the file.
Distributions answer over IPv4.
With the default certificate, your files are now served through the CDN at the Distribution URL. Put that address in your site’s pages wherever they link to these files. To tune how long files stay cached, see Change distribution settings. For help when the create fails or a file does not load, see Troubleshooting CDN.