title: asp.net core Parameter count mismatch between X-Forwarded-For and X-Forwarded-Proto
body: <pre><code>CloudFlare
  
  IIS ARR 
  
  Asp.net core 1.1.1
  </code></pre>
  
  <p>I'm behind cloudflare and then behind iis arr.</p>
  
  <p>cloudflare is in http only mode</p>
  
  <p>I'm constantly getting </p>
  
  <blockquote>
    <p>Parameter count mismatch between X-Forwarded-For and
    X-Forwarded-Proto.</p>
  </blockquote>
  
  <p>my startup file </p>
  
  <pre><code> ForwardedHeadersOptions forwardOption = new ForwardedHeadersOptions
          {
              ForwardedHeaders = Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedFor | Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedProto,
              ForwardLimit = 2
          };
          forwardOption.KnownProxies.Add(IPAddress.Parse("xxxxx"));
          forwardOption.KnownProxies.Add(IPAddress.Parse("xxxxx"));
          forwardOption.KnownProxies.Add(IPAddress.Parse("xxxxxx"));
          forwardOption.KnownProxies.Add(IPAddress.Parse("xxxxxx"));
          app.UseForwardedHeaders(forwardOption);
  </code></pre>
  
  <p>and i have set this rewrite rule at iis arr level  i also have tested https</p>
  
  <pre><code>HTTP_X_FORWARDED_PROTO
  http
  replace the existing value
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/y73vk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y73vk.png" alt="enter image description here"></a></p>
  
  <p>what's the problem?</p>
  
  <p>here is a <a href="https://github.com/aspnet/IISIntegration/issues/111" rel="nofollow noreferrer">link</a> but no help</p>