# How do I resolve "err_too_many_redirects" when using a Cloudflare proxy with Vercel?

**Author:** Justin Vitale

---

When [assigning a domain](https://vercel.com/docs/custom-domains#adding-a-domain) to a [Project](https://vercel.com/docs/platform/projects) on Vercel that is currently using a Cloudflare proxy, you may encounter the error `"err_too_many_redirects"`. In this article, we will explain why this error occurs and what changes you need to make to resolve it.

## Why Does This Error Happen?

This error occurs when your Cloudflare SSL/TLS configuration is set to "Flexible". Under that scenario, Cloudflare will send requests from their servers to your Vercel [deployment](https://vercel.com/docs/platform/deployments) using HTTP instead of HTTPS. After Vercel answers Cloudflare's request, they will forward the response using HTTPS.

Since Vercel will automatically upgrade all HTTP requests to use SSL when a certificate is present, a [308 status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308#:~:text=The%20HyperText%20Transfer%20Protocol%20) is sent to the client, causing a redirect to the same location.

Here is a quick summary of the issue:

- Cloudflare is serving `https://example.com` and making requests to `http://example.com` on Vercel.
  
- Vercel identifies an unprotected request to `http://example.com` and sends a [308 status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308#:~:text=The%20HyperText%20Transfer%20Protocol%20) redirect to `https://example.com`.
  
- Cloudflare will forward the redirect to the user. However, since the client is already on `https://example.com`, it will generate a redirect to the same location, causing a loop.
  

## Solution

To fix the issue, you need to set the "SSL/TLS" option in Cloudflare to "Full". It is important to also follow the instructions in our [Cloudflare guide](https://vercel.com/docs/integrations/cloudflare) so the domain keeps working without any issues.

---

[View full KB sitemap](/kb/sitemap.md)
