ERR_TOO_MANY_REDIRECTS when deploying Flutter Web app with a Cloudflare proxy

Hey there! :wave:

I’m having some trouble setting up a Cloudflare proxy with as the origin server. To make a long story short, I have our small app deployed at However, when trying to create a proxy in Cloudflare (, we are getting an ERR_TOO_MANY_REDIRECTS error in the browser.

This is quite weird because we have apps deployed to that work fine with Cloudflare as a proxy (e.g. our auth app, which you will see in the screenshots below).

What we’ve tried

You can find a thread of our attempts of fixing this at Deploy `Flutter` App to · Issue #312 · dwyl/app · GitHub.

But here’s a quick summary, in order:

  • used the IPv4 address from and paste it into Cloudflare’s DNS config page. We’ve waited for these DNS records to update.

  • we’ve allocated a dedicated IPv4 to our page and updated it on Cloudflare’s DNS page.
    Notice that the Shared v4 pill now displays only v4, meaning we’ve done this IPv4 allocation correctly.

  • we’ve tried changing the SSL/TLS encryption mode in Cloudflare’s dashboard from Flexible to Full. However, when we try to do this, instead of ERR_TOO_MANY_REDIRECTS error, we get an SSL handshake failed error. And unfortunately, when we do this, our working app auth that we’ve previously mentioned also stops working.

And that’s what we’ve tried so far. We’ve gone over Cloudflare’s Troubleshooting Docs for this error and they state “it’s commonly caused by a misconfiguration in SSL/TLS Encryption mode” (which we’ve tried to change).

Have any of you ever faced this problem when deploying a Flutter Web App? It’s a simple Static Website that does not yet have any navigation, so it’s most likely a problem with’s default configuration of the server. But we’re having some trouble finding what exactly.

Thank you very much for your time!

@LuchoTurtle consider reframing your question to focus on the more general issue:
subdomain routing to a static website hosted on

  1. Deployed our Flutter Web App to and it’s working: :white_check_mark:
  2. We have deployed Phoenix Apps to in the past and they have worked with a subdomain defined in Cloudflare e.g: or
  3. We have followed the steps that worked for us in the past to setup a subdomain on Cloudflare to point to but are getting a Redirect error:

We don’t think this is a Cloudflare issue because the CNAME record is just:

Which is what the flyctl CLI recommended, see: Chore: investigate "redirected you too many times." error for `` · Issue #316 · dwyl/app · GitHub

So our question is: does anyone else in the community/team have experience with configuring subdomains for static websites (which is all our Flutter Web App is …)?
Has anyone experienced this redirect issue before?


I’m not too familiar with Cloudflare, but:

lillian ~ % curl --head --resolve
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to

You don’t have a SSL certificate applied to your app, so our proxy can’t respond to HTTPS connections from Cloudflare.

lillian ~ % curl --head --resolve
HTTP/1.1 301 Moved Permanently

With force_https enabled in your fly.toml, it can’t respond to HTTP connections either. Your admin app doesn’t have force_https enabled, so Cloudflare is making plaintext connections to it.

I looked at your github thread, and you did try to create a TLS certificate for your domain on Fly. It didn’t work because our certificate manager checks the DNS records to see if your domain is set up correctly, and Cloudflare’s “proxied” records replace the values you set to point to their proxy.
If you do want to keep the Cloudflare proxy, I think you can use TXT record verification, but I’m not sure if we have that set up for single subdomains or only wildcards. I’ll check and let you know!


I’m facing the same issue as well. Previous apps work fine with Cloudflare. Hoping to know if there’s a solution to the issue.

1 Like