In the life of each admin there are moments when you need to be strong and inexpensive. Often, such tasks contribute to personal growth and become the first steps to rigid perversions. Now I will try to describe just such a case.
Need to publish information on the web site. Information must be protected from changes. Information placed on the site should be available regardless of the payload or parasitic load on the web server.
What is a CDN (Content Delivery Network) is a few servers that cache the resources of your web site and give to consumers. CDNs now have many more features, but the meaning is exactly that.
The site will be issued from the cache, so dynamically generated content on the server side should be excluded, because it will be executed on the source server of the provider and the meaning of using the CDN will be partially lost. Also, in order not to get DDOS over ip, I strongly recommend changing the ip of the original site after connecting the CDN.
The content of the site will be given over the HTTPS channel in order for the user in theory to check the certificate and decide that everything is fine. But as practice has shown, people only look at the color of the lock in the address bar of the browser.
Most CDNs offer two options for distributing output via their servers to the site via HTTPS.
The first option is under the certificate of the original site. Requires a full wildcart SSL certificate closing subdomains.
The second option - the site resources are given under the CDN certificate, the user will also have a green lock in the address bar of the browser.
These features allow you to distribute one CDN through another.
CDN -1 - distribution agreement under the site certificate.
To do this, in the site code, the paths to the resources need to be changed to cdn.your website.com after having entered the corresponding CNAME record in the DNS zone of the domain with the value obtained from cdn support.
CDN-2 - for example, the free cloudflare rate. After setting up the site on the CDN-1 is connected in normal mode using the setup wizard.
After configuring both CDNs, we see in the DNS settings of the cloudflare entry:
As a result, your site resources are not CDN-1 cached distributed directly to site visitors from CDN-1 servers, but first they are sent to the CDN-2 cache in the example of Cloudflare, and then from the Cloudflare cache are already given to site visitors.
This article describes only one task from a long list of strange solutions for publishing information on a web * site under unusual conditions.
Source: https://habr.com/ru/post/354846/
All Articles