title: Why do I have to change from Flexible to Full to solve my "too many redirects" problem with cloudflare?
body: <p>I just setup a new website.</p>
  <p>After setting up everything (SSL with LetsEncrypt), there is a too many redirects problem.</p>
  <p>It took me hours to figure out that I can just solve it by switching from Flexible to Full in my cloudflare seetings. But why? Can somebody explain details to me?</p>
  <p><a href="https://i.stack.imgur.com/xtu6W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xtu6W.png" alt="enter image description here" /></a></p>
  <p>Nginx conf:</p>
  <pre><code>server {
   
    server_name mysite.com;
   
    root /root/mysite;
    index index.html;
   
    location / {
      try_files $uri $uri/ =404;
    }
  
  
      listen 443 ssl; # managed by Certbot
      ssl_certificate /etc/letsencrypt/live/mysite.com/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/mysite.com/privkey.pem; # managed by Certbot
      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  
  }
  
  server {
      if ($host = mysite.com) {
          return 301 https://$host$request_uri;
      } # managed by Certbot
  
  
   
    server_name mysite.com;
      listen 80;
      return 404; # managed by Certbot
  
  
  }
  </code></pre>