Add a CDN service to your site

This article mainly describes how to configure the cdn acceleration service for the site, the supplier is Paiyun

【Add a CDN service to site】question


After I configured it, I found out: Why is the site not opening as fast as before? Isn't it cdn acceleration? Why is this slowing down?

So I started the review, and the final result was: CNAME parsing error , that is, the provider was not resolved. My God, it turns out that I have opened the service for nearly a month, but it is not turned on, and it crashes in an instant. Let's take a look at how to correctly turn on the cdn site-wide acceleration service.

【Add a CDN service to site】Knowledge point


In order to let everyone understand more clearly, here is a wave of explanations of entries, and then explained in a simple way
DNS resolution
Domain name resolution (Domain Name System) is a service that points the domain name to the web space IP, allowing people to easily access the website through the registered domain name. An IP address is a digital address that identifies a site on the network . For the convenience of memory, a domain name is used instead of an IP address to identify the site address. Domain name resolution is the process of converting a domain name to an IP address. The resolution of the domain name is done by the DNS server. Domain name resolution is also called domain name pointing, server settings, domain name configuration, and reverse IP registration, etc. To put it simply, it is to resolve a memorable domain name into an IP, and the service is completed by a DNS server, which resolves the domain name to an IP address, and then binds a subdirectory to the domain name on the host of this IP address.
In layman's terms, it uses a string of domain names that you can define yourself to resolve to complex and inconvenient IP addresses . Addresses on the Internet are digital IP addresses, and the function of domain name resolution is mainly to facilitate memory.
CDN
CDN (Content Delivery Network), the content distribution network. CDN is an intelligent virtual network built on the basis of the existing network, relying on edge servers deployed in various places, through the load balancing, content distribution, scheduling and other functional modules of the central platform, so that users can obtain the desired content nearby, reducing network congestion, Improve user access response speed and hit rate. The key technologies of CDN mainly include content storage and distribution technology.
In short, when users access server resources, users in different regions have different response speeds according to the distance from the server. You can understand it as double eleven spike shopping. If you are next to the server, theoretically you can spike the corresponding product. The probability is much greater than other users

CDN provider has many servers distributed in different regions. When the resources you need to access are added to the CDN , the CDN server will periodically copy the resources from your server. In this way, when users access resources on your server, cdn will automatically allow users to access resources on a cdn server closest to them
According to the distance, the user's request is allocated to different servers, so as to achieve the role of acceleration, that is, the content distribution network
HTTPS
HTTPS (Hyper Text Transfer Protocol over SecureSocket Layer) is a secure HTTP channel. On the basis of HTTP, transmission encryption and identity authentication are used to ensure the security of the transmission process. HTTPS adds SSL on the basis of HTTP. The security basis of HTTPS is SSL, so the encrypted details require SSL. HTTPS has a different default port than HTTP and an encryption/authentication layer (between HTTP and TCP). This system provides authentication and encrypted communication methods. It is widely used for security-sensitive communications on the World Wide Web, such as transactions and payments.
Look at the picture, I believe you must have encountered such a website

When this happens, it means that this website uses the HTTP protocol to transmit data, and users are reminded to visit the website with caution. The HTTP protocol is a clear text transmission protocol. It cannot encrypt the transmitted data or verify the integrity of the data, nor can it perform authentication. At this time, it is necessary to understand the SSL certificate.
SSL
SSL (Secure Sockets Layer Secure Sockets Protocol), and its successor Transport Layer Security (TLS) is a security protocol that provides security and data integrity for network communications. TLS and SSL encrypt network connections between the transport layer and the application layer.
For personal use, there are no higher requirements. We just go to the supplier to purchase a free certificate. The configuration will be described in detail below.

【Add a CDN service to site】Configure CDN service


bind upyun
Here I remind everyone that when using a new product, you must read the official documentation carefully, otherwise, how can there be a saying that a product without good documentation is not a qualified product? For the binding and registration of upyun resources, please visit the official documentation directly
Add parsing records
The main point I want to emphasize here is the addition of dns records. After you get the corresponding CNAME domain name here, you can add resolution records to the provider of the domain name. Here I take Wanwang access as an example.
Find the add record in the DNS console of Cloud DNS

Special attention should be paid to the location of the host record . There are two situations as follows:
•TLD: The host record is @
•Subdomain name: The host record is a second-level domain , for example: synopsis.coder-jason.cn is a second-level domain name, and the host record is filled with synopsis
The rest of the items are configured as shown below

test
We open the command line tool locally, enter the ping command to our domain name, check whether the dns configuration takes effect, and get a response from the icon that the configuration is successful, or we can test the configuration through official methods
Security improvement
SSL certificate deployment
You can find the digital certificate management service console at the domain name provider , fill in the information and submit the application

After the review is passed, we can download and deploy it. Here we take Nginx deployment as an example. After installing the pagoda panel on the server (for detailed steps, please refer to the article), click the ssl certificate , and paste the downloaded certificate in the corresponding window. Pay attention to distinguish the file suffix and do not paste the wrong one.

Because the cdn service of Youpaiyun is used, it is also necessary to add a certificate in the position shown in the figure.

At this point, the website has achieved encrypted access. You can check the configuration status through the ssl status detection tool
IP access restrictions
upyun Cdn management console pull down to find Ip access restrictions

Click Manage to add restriction rules

click save

CC protection
in upyun Find CC protection in the access control of the cdn management console and add protection rules

click save

Shoot the cloud alliance again
If you don't mind adding the logo of the service provider at the bottom of the site, you can join the Youpai Cloud Alliance to get 10GB of storage space + 15GB of traffic per month for free

Click here to preview the added effect


Configuration Tutorial
•Server installation pagoda panel
Copyright statement: The content of this article is contributed by Alibaba Cloud's real-name registered users. The copyright belongs to the original author. The Alibaba Cloud developer community does not own the copyright and does not assume the corresponding legal responsibility. For specific rules, please refer to the " Alibaba Cloud Developer Community User Service Agreement " and " Alibaba Cloud Developer Community Intellectual Property Protection Guidelines ". If you find any content suspected of plagiarism in this community, fill out the infringement complaint form to report it. Once verified, this community will delete the allegedly infringing content immediately.

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00