Good question 👍 Let me explain clearly why that happens:
🔁 What “Flexible SSL” does
- With Flexible SSL, Cloudflare accepts HTTPS from the browser → Cloudflare,
but Cloudflare connects to your server over plain HTTP (not HTTPS).
🔁 What happens if your app forces HTTPS
- Many apps (via Nginx, Apache, Express, etc.) are set to force HTTPS redirects — if a request comes in over HTTP, the app says: “No, go to https://…”.
- But Cloudflare is calling your server over HTTP.
- So the server responds: “Please use HTTPS”.
- Cloudflare tries HTTPS → still uses Flexible mode → goes back to HTTP when talking to your server.
- This repeats forever → 🔄 infinite redirect loop.
✅ How to fix
- If your server has a valid SSL certificate (even self-signed or Let’s Encrypt):
→ Use “Full” or “Full (Strict)” SSL mode in Cloudflare. - If your server truly can’t do HTTPS:
→ Don’t force HTTPS in your app/web server, or turn off proxy (grey cloud).
👉 So the loop happens because Cloudflare is lying to your server (it says “I’ll handle HTTPS” but only asks your server over HTTP), while your server insists on HTTPS. They keep bouncing each other endlessly.
Do you want me to check which SSL mode your Cloudflare is currently set to and tell you which one fits your setup?
0 Comments