If you use Cloudflare as a proxy and receive an error about too many redirects (redirect loop) when accessing your domain, this is due to faulty communication between Cloudflare and your web server. Usually, your server enforces a secure connection, while Cloudflare tries to retrieve the data unencrypted.
Cause of the problem
The error usually occurs because of the Cloudflare setting Flexible. In this mode, Cloudflare contacts your server over the unencrypted HTTP protocol. However, since your server is configured to redirect all requests to HTTPS, it sends Cloudflare back to the encrypted version. Cloudflare then requests again via HTTP, which triggers the redirect loop.
Step-by-step guide to fix
You need to instruct Cloudflare to establish a secure connection to your origin server to comply with your server's security rules.
Log in to your
Cloudflare Dashboard.Select the affected domain.
Click on
SSL/TLS»Overviewin the left sidebar.Check the current encryption mode. It is likely set to
Flexible.Change the setting to
FullorFull (Strict).
By making this change, Cloudflare communicates with your server via HTTPS, which eliminates the forced redirect and allows the site to load correctly.
Note: This topic covers the configuration of a third party (Cloudflare) in combination with your domain security. Make sure that a valid SSL certificate is installed on your origin server if you choose the Full (Strict) option.
Comments
0 comments
Please sign in to leave a comment.