Issue
Browsers display the message when users access your domain name accelerated by CDN: "This page isn't working. <Your domain> redirected you too many times. (Error: ERR_TOO_MANY_REDIRECTS)".

Cause
A client requests an accelerated domain via HTTPS, but the CDN fetches content over HTTP. The origin server's HTTP to HTTPS redirect rules cause a loop, and when the browser's redirect limit is exceeded, it stops the request and reports an error.
The following diagram illustrates the process:
The client sends a request to access the accelerated domain name (for example,
https://example.alibabacloud.com/) over HTTPS protocol using port 443.By default, CDN fetches content from the origin server (for example,
http://example.alibabacloud.com/) over HTTP protocol using port 80.The origin server has HTTP to HTTPS redirect rules configured.
Therefore, when content is retrieved over HTTP protocol, the origin server returns a 301 or 302 status code in its response with URL using HTTPS protocol for redirection. Then the client follows the redirect rule and initiates a new request over HTTPS, ultimately reaching the accelerated domain name.
This process creates a continuous cycle of redirections. Once the redirect limit in the browser is exceeded for a request, the browser stops the request and reports an error.
Solution
Follow these steps to resolve the issue:
Set the origin server port to 443
Log on to the Alibaba Cloud CDN console.
In the left-side navigation pane, click Domain Names.
On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.
In the Origin Information section, click Modify in the Actions column.
Change the port of the origin server to
443, and then click OK.
(Optional) Modify the origin protocol policy
Skip this step if the Origin Protocol Policy feature is not enabled.
Log on to the Alibaba Cloud CDN console.
In the left-side navigation pane, click Domain Names.
On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.
In the left-side navigation tree of the domain name, click Origin Fetch.
On the Configurations tab, find the Origin Protocol Policy section, and click Modify.
Choose Follow for Protocol Type and click OK.
Purge the cache
Log on to the Alibaba Cloud CDN console.
In the left-side navigation pane, click Purge and Prefetch.
For Operation, select Purge, and for Operation Method, select Directory.
In the URL field, enter the base URL of your domain. Note that the URL must start with
https://orhttp://and end with/.For example, if the accelerated domain name is
https://www.example.com/image/static/1.png, enterhttps://www.example.com/.Click Submit to start the cache purge task.
You can view the progress of the cache refresh task in the Records tab.
Clear your local browser cache
Take Chrome browser as an example:
In the upper-right corner of Chrome browser, click the More icon
Dlete Browsing Data...Select a time range, such as Last hour or All time.
Select the types of information you want to delete. Cached images and files is required.
Click Delete data.
Verify the setup
Verify using one of the following methods:
Run
curl -I accelerated_domain_name(for example,curl -I https://www.example.com/image/static/1.png) in a terminal or command-line interface (CLI) of your operating system to check if the response header contains theLocationheader. If theLocationheader is absent, the issue has been resolved.Use the browser's incognito mode to access the accelerated domain name.