All Products
Search
Document Center

CDN:Too many redirects after CDN acceleration

Last Updated:Feb 27, 2026

When you access a domain name accelerated by Alibaba Cloud CDN, the browser displays the following error:

"This page isn't working. *example.com* redirected you too many times. (Error: ERR_TOO_MANY_REDIRECTS)"

Too many redirects error

This error occurs when CDN and your origin server create a redirect loop. The following sections explain the root cause and how to fix it.

How the redirect loop occurs

A client requests an accelerated domain via HTTPS, but CDN fetches content from the origin server 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 most common scenario:

  1. A client sends an HTTPS request (port 443) to the accelerated domain name, such as https://example.alibabacloud.com/.

  2. CDN fetches content from the origin server over HTTP (port 80) by default, requesting http://example.alibabacloud.com/.

  3. The origin server has HTTP-to-HTTPS redirect rules configured and returns a 301 or 302 status code pointing back to the HTTPS URL.

  4. The client follows the redirect and sends a new HTTPS request, which CDN again fetches over HTTP from the origin.

  5. This cycle repeats until the browser's redirect limit is reached.

Redirect loop diagram

Fix the redirect loop

Identify which cause applies to your configuration and apply the corresponding fix.

Cause 1: Origin server port set to 80 while the origin has HTTPS redirects

This is the most common cause. CDN fetches content over HTTP (port 80), and the origin server redirects HTTP requests to HTTPS, creating the loop.

Fix: Change the origin server port to 443

  1. Log on to the Alibaba Cloud CDN console.

  2. In the left-side navigation pane, click Domain Names.

  3. Find the target domain name and click Manage in the Actions column.

  4. In the Origin Information section, click Modify in the Actions column.

  5. Change the port to 443 and click OK.

Change origin server port to 443

Cause 2: Origin protocol policy set to HTTP

If Origin Protocol Policy is enabled and set to HTTP, CDN always sends HTTP requests to the origin, even when the client uses HTTPS. Combined with an HTTP-to-HTTPS redirect on the origin, this triggers the same loop.

Skip this section if Origin Protocol Policy is not enabled for your domain.

Fix: Set the origin protocol policy to Follow

  1. Log on to the Alibaba Cloud CDN console.

  2. In the left-side navigation pane, click Domain Names.

  3. Find the target domain name and click Manage in the Actions column.

  4. In the left-side navigation tree, click Origin Fetch.

  5. On the Configurations tab, find Origin Protocol Policy and click Modify.

  6. Set Protocol Type to Follow and click OK.

When set to Follow, CDN uses the same protocol as the client request. HTTPS requests from the client result in HTTPS origin fetches, which avoids the redirect.

Clear cached redirects

After applying the fix, purge both the CDN cache and your browser cache. CDN nodes and your browser may still have the 301 or 302 redirect response cached.

Purge the CDN cache

  1. Log on to the Alibaba Cloud CDN console.

  2. In the left-side navigation pane, click Purge and Prefetch.

  3. Set Operation to Purge and Operation Method to Directory.

  4. Enter the base URL of your domain. The URL must start with https:// or http:// and end with /. For example, if the accelerated domain name is https://www.example.com/image/static/1.png, enter https://www.example.com/.

  5. Click Submit.

  6. Check the progress on the Records tab.

Clear your browser cache

Using Chrome as an example:

  1. Click the More icon More icon > Arrow Delete Browsing Data.

  2. Select a time range, such as Last hour or All time.

  3. Select Cached images and files (required).

  4. Click Delete data.

Verify the fix

Use either method to confirm the redirect loop is resolved:

  • curl: Run the following command and check whether the response contains a Location header. If the Location header is absent, the issue is resolved. Replace https://www.example.com/ with your accelerated domain name.

      curl -I https://www.example.com/
  • Incognito mode: Open a new incognito or private browsing window and access the accelerated domain name. An incognito window has no cached redirects, so the result reflects the current CDN configuration.