All Products
Search
Document Center

CDN:Too many redirects after CDN acceleration

Last Updated:Jun 10, 2026

When you access a domain name accelerated by Alibaba Cloud CDN, the browser reports the ERR_TOO_MANY_REDIRECTS error. This error occurs when CDN and the origin server enter a redirect loop. This topic describes how to identify the cause and resolve the issue.

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

Too many redirects error

Two CDN misconfigurations commonly cause this error:

Identify which applies to your setup, apply the fix, then clear both caches.

How the redirect loop occurs

CDN fetches content from the origin over HTTP by default, even when the client request arrives over HTTPS. If the origin has HTTP-to-HTTPS redirect rules, it returns a 301 or 302 redirect to CDN, which then makes another HTTP request — and the loop repeats until the browser's redirect limit is exceeded.

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 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 creates 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 matches the protocol used by the client request. HTTPS client requests result in HTTPS origin fetches, breaking the loop.

Clear cached redirects

After applying the fix, purge both the CDN cache and your browser cache. CDN nodes and your browser may have the 301 or 302 redirect response cached and will keep replaying it — even after you update the CDN configuration — until those caches are cleared.

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

Browsers cache 301 and 302 redirect responses and replay them locally, bypassing CDN entirely. Clear the browser cache after fixing the CDN configuration.

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.