-
-
Notifications
You must be signed in to change notification settings - Fork 902
How to use Amazon CDN
-
To do this, first point an A record to your server address in DNS. Suppose you have pointed sub1.domain.com to the IP address of your server.
-
Go to Amazon AWS and search for Cloudfront service.
-
Create a destination by clicking create distribution.
-
Enter the values in the opened page according to the image below.
All values on this page are default except for the following which should be set as shown in the images.
- At the end, click on
create distributionto perform the creation operation. - In the next step, go to the location of your DNS records. Assuming that you have registered in Cloudflare, enter the DNS section of your domain and create a cname record. Suppose you create
sub2.domain.comand set its value equal to the domain created in the previous step in AWS. This value can be seen in thedetailssection underDistribution domain name.
In fact, this subdomain will be used for our CDN domain.
- Go back to the AWS panel and click on the
editoption in theGeneraltab of thesettingsection and click onAdd itemin theAlternate domain name (CNAME) - optionalsection that opens. and enter the cname domain from the previous step,sub2.domain.com.
-
Enter the
Custom SSL certificate - optionalsection and get anssl certificatefor the desired domain. For this, click onRequest certificate. -
In the newly opened page, continue the process of receiving the certificate and in the
domain namesection and the address field, enter the details of the subdomain registered in the previous step, namelysub2.domain.comand set the other values as default. and click onRequest. -
On the certificate list page, you can see that the desired domain status is
pending validation. Click on the ID and see theDomainssection on the opened page.
- In this section, two values of this section,
Cname nameandCname valueare needed to complete the certificate status. - Go to your DNS records (presumably Cloudflare) and create a
Cname namerecord and enter the values you had in the previous step in AWS. In Cloudflare, enterCname nameinstead ofnameandCname valueinstead ofTarget. - Now if you go back to AWS and the certificate list page and refresh the page, you will see that the status has changed from
pendingtoissues, which means that our domain has received the certificate correctly. - Now it is back to the
distributionsettings page and the certificate derivation stage, and if you click the refresh button forcustom ssl, you can see the certificate you received in the previous stage. Select it and leave the other values of this page as default.
Tip
Note: Be careful not to tick the Legacy client support because this option costs $600 per month.
- At the end, click the save changes option to save the changes.
- Now wait until the changes are applied and according to the image below, the state of
Last modifiedwill change fromDepoloyingto done to the date and time.
-
It usually takes between 2-5 minutes for these changes to be applied, which can be followed by refreshing the screen. Always remember that at any stage you make changes, it should change to this state, which means that the changes are fully applied and usable.
-
Congratulations, the work is done. Amazon Cloudfront CDN is successfully launched. Now just register your CDN domain in your HiFi Manager.
فارسی