title: ASP.NET Core's suggested Nginx config
body: <p>I'm deploying an ASP.NET Core 6 webapp, using Nginx as reverse proxy.</p>
  <p>I usually use some variation of this config for my aspnet apps, and it works:</p>
  <pre class="lang-ini prettyprint-override"><code>listen 443 ssl http2;                       # HTTP/2
  listen [::]:443 ssl http2;                  # HTTP/2
  # ...
  proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Host  $host;
  proxy_set_header X-Forwarded-Proto $scheme;
  </code></pre>
  <p>The aspnet docs however <a href="https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-6.0#configure-nginx" rel="nofollow noreferrer">show this</a>:</p>
  <pre class="lang-ini prettyprint-override"><code>proxy_http_version 1.1;                     # HTTP/1.1
  proxy_set_header   Upgrade $http_upgrade;
  proxy_set_header   Connection keep-alive;
  proxy_set_header   Host $host;
  proxy_cache_bypass $http_upgrade;
  proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header   X-Forwarded-Proto $scheme;
  </code></pre>
  <p>They recommend different headers.</p>
  <p>I assume it's because they use <code>HTTP/1.1</code> whereas I'm using <code>HTTP/2</code> - am I right, and can I thus ignore their recommendation?</p>