A website hosted in Plesk fails to load when Cloudflare is used: ERR_TOO_MANY_REDIRECTS Print

  • 0

Website Fails to Load When Cloudflare is Used: ERR_TOO_MANY_REDIRECTS

Symptoms

A website behind Cloudflare shows the following error message in a web browser:

ERR_TOO_MANY_REDIRECTS
The page isn’t redirecting properly

ERR_TOO_MANY_REDIRECTS

When Cloudflare is disabled, the website loads fine.

Turn off cloudflare in DNS record

 

The Permanent SEO-safe 301 redirect from HTTP to HTTPS setting is enabled in Plesk at Domains > example.com > Hosting Settings, or custom HTTPS redirection is configured in the domain's .htaccess file.

Plesk Hosting Settings

Additionally, trying to issue a Let's Encrypt certificate for the domain fails with the following error:

Invalid response from https://acme-v02.api.letsencrypt.org/acme/authz-v3/11481922061.
Details:
Type: urn:ietf:params:acme:error:connection
Status: 400
Detail: Fetching /.well-known/acme-challenge/UcTI6ov0Pc3Fn2IRnNUiFKZKzBu5NaAy4IoscLbYh_I: Redirect loop detected

Errors like the following appear in the /var/log/plesk/panel.log:

[2024-10-02 15:49:29.258] 25266:66fd4f4eab0c0 ERR [extension/sslit] Unable to renew domain example.com certificate automatically Invalid response from https://acme-v02.api.letsencrypt.org/acme/authz-v3/410952962857.
Detail: Fetching https://example.com/.well-known/acme-challenge/MBAnSZPyIqayq0YRyAZZ-_5b-JJxWq2b64h7kEZtzCg: Redirect loop detected

Cause

The SSL/TLS encryption mode is set to Flexible on the Cloudflare dashboard for this domain. This prevents proper access to the website files via HTTP.

Note: The SSL/TLS encryption mode for any domains using Cloudflare nameservers should always be set to Full (strict) when their website content resides on a Plesk server. This ensures that only the SSL certificate installed on the Plesk server is used.

First Resolution

  1. Log into your Cloudflare.com account.
  2. Go to example.com > SSL/TLS and change the SSL mode to Full (strict).

Cloudflare change SSL mode to Full

 

Second Resolution - If you don't have any access to Cloudflare.

You may turn off The "Permanent SEO-safe 301 redirect from HTTP to HTTPS" setting in Plesk at Domains > example.com > Hosting Settings

Turn off Permanent SEO-safe 301 redirect from HTTP to HTTPS setting


Was this answer helpful?

« Back