title: ASP .NET Core https rewrite does not seem to work
body: <p>Env: ASP.NET Core 2.0. App gets deployed to IIS on Windows Server 2016.</p>
  
  <p>In my startup.cs, I have the following code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public void ConfigureServices(IServiceCollection services)
    ...
    services.Configure&lt;MvcOptions&gt;(options =&gt; {
        options.Filters.Add(new RequireHttpsAttribute());
    });
  }
  
  public void Configure(IApplicationBuilder app, IHostingEnvironment env) {
     ...
     var options = new RewriteOptions().AddRedirectToHttps();
     app.UseRewriter(options);
  }
  </code></pre>
  
  <p>However, when the app is deployed to IIS, I do not see <code><a href="http://xxx" rel="nofollow noreferrer">http://xxx</a></code> getting changed to <code><a href="https://xxx" rel="nofollow noreferrer">https://xxx</a></code> in the browser.</p>
  
  <p>I can directly go to <code><a href="https://xxx" rel="nofollow noreferrer">https://xxx</a></code> and that seems to work. However, the idea is to automatically redirect http requests to https. </p>
  
  <p>What is it that I am missing? Do I need to do something on IIS as well? Regards. </p>