Site not loading after CloudFlare nameservers(ns) DNS update
Website down after changing nameservers (DNS) to Cloudflare
Issue:
Followed the provided instructions to update the DNS to Cloudflare. Subsequently, received a confirmation message indicating that the site had been activated, but unfortunately, it is not functioning as expected – the site keeps redirecting and the website is not loading any page
solution/ fix:
Chances are, you have configured your SSL mode as ‘Flexible‘ in Cloudflare which can lead to a continuous loop and trigger the ‘too many redirects’ error. Switching your SSL mode to Full (Strict) should fix this issue as long as you are using either a valid public certificate or a Cloudflare Origin CA certificate on your site
Implement the simple configuration changes (steps) given in this link – change the SSL/TLS setting in Cloudflare from “Flexible” to “Full” (strict). After changing/ switching to Full (Strict) mode, try loading your website again, it should work.
Explanation in Detail
Resolving DNS nameservers Issues with Cloudflare’s SSL/TLS Settings and HTTPS Redirection
It seems like you’re describing a common issue that can occur when configuring SSL/TLS settings and handling HTTPS redirection in a web server or content delivery network (CDN) like Cloudflare. Let me explain this issue and provide a solution:
- Flexible SSL Setting: In Cloudflare’s SSL/TLS settings, when you set it to “Flexible,” it means that the connection between the client (user’s browser) and Cloudflare is encrypted using HTTPS, but the connection between Cloudflare and your origin server is not encrypted and still uses HTTP.
- Origin Server Redirects to HTTPS: If your origin server is configured to redirect HTTP requests to HTTPS, it will send a “301 Moved Permanently” or “302 Found” HTTP response to the client, instructing it to use HTTPS for the connection.
Here’s where the issue arises:
- When a user accesses your website, Cloudflare initially sends the request to your origin server over HTTP (because of the “Flexible” SSL setting).
- Your origin server responds with a redirect to HTTPS.
- The client follows the redirect and makes an HTTPS request to Cloudflare.
- Cloudflare receives the HTTPS request and forwards it to your origin server, but because the SSL setting is “Flexible,” it still uses HTTP to communicate with your origin server.
- Your origin server again responds with a redirect to HTTPS.
- This cycle repeats, resulting in a redirect loop.
To resolve this issue, you have a few options:
- Change SSL/TLS Setting: As mentioned above, the best solution is to change the SSL/TLS setting in Cloudflare from “Flexible” to “Full” (strict). This ensures that both the client-to-Cloudflare and Cloudflare-to-origin server connections are encrypted with SSL/TLS. To do this, you’ll need to install an SSL certificate on your origin server.
- Install an SSL Certificate on Your Origin Server: If you cannot or do not want to change the SSL/TLS setting in Cloudflare, you should install an SSL certificate on your origin server. This allows you to have an encrypted connection between Cloudflare and your server, even when the SSL setting in Cloudflare is “Flexible.”
- Update Page Rules: If you have specific pages or URLs that you want to keep using “Flexible” SSL while others use “Full” (strict), you can create Page Rules in Cloudflare to set the SSL setting on a per-path basis.
It’s generally recommended to use “Full” (strict) SSL whenever possible for improved security.