Redirect loop when using "Cloudflare SSL/TLS encryption mode is Flexible"
brian32768 opened this issue · 1 comments
When CF encyrption mode is set to flexible, when a request hits CF and it's proxied there, then CF will send the request to the upstream unencrypted. The Caddy reverse proxy will then redir the request to port 443. So the HTTP response never makes it back to the CF server and it throws a "308 redirect too many times" error.
I found that I could use an API call to edit the Caddy config and change "listen" from ":443" to ":80", ":443" so that the reverse would no longer force the redirect. Unfortunately (1) as soon as something happens it rewrites the file and (2) this affects ALL sites on the proxy not just the one I want to modify.
I need a way to tell the proxy to stop doing the 80->443 redirect for this one site.
Is there already a way to do this?
I have disabled the proxy/https thing on Cloudflare because it's probably more important for me to have end-to-end encyrption than to have caching and IP hiding at Cloudflare?
Ahhh, I got it, in Cloudflare, SSL/TLS setting needs to be set to
"Full (strict) Encrypts end-to-end, but requires a trusted CA or Cloudflare Origin CA certificate on the server"