title: Can't develop with HTTP, always getting redirected to HTTPS
body: <p>I was testing my ASP.NET CORE MVC webapp with HTTPS configuration. To do so, i put on startup.ConfiguraServices:</p>
  
  <pre><code>services.AddHttpsRedirection(options =&gt;
          {
              options.RedirectStatusCode = StatusCodes.Status307TemporaryRedirect;
              options.HttpsPort = 443;
          });
  </code></pre>
  
  <p>On startup.Configure:</p>
  
  <pre><code>app.UseHttpsRedirection();
  </code></pre>
  
  <p>and configured the Kestrel server as follows:</p>
  
  <pre><code>public static void ConfigureKestrelServerOptions(this KestrelServerOptions options)
      {
          var configurationService = options.ApplicationServices.GetRequiredService&lt;IConfiguration&gt;();
          var environmentService = options.ApplicationServices.GetRequiredService&lt;IHostingEnvironment&gt;();
  
          var endpoints = configurationService.GetSection("HttpServer:Endpoints")
              .GetChildren()
              .ToDictionary(section =&gt; section.Key, section =&gt;
              {
                  var endpoint = new EndPointSettings();
                  section.Bind(endpoint);
                  return endpoint;
              });
  
          foreach (var endpoint in endpoints)
          {
              var config = endpoint.Value;
              var port = config.Port ?? (config.Scheme == "https" ? 443 : 8080);
  
              var ipAddresses = new List&lt;IPAddress&gt;();
              if (config.Host == "localhost")
              {
                  ipAddresses.Add(IPAddress.IPv6Loopback);
                  ipAddresses.Add(IPAddress.Loopback);
              }
              else if (IPAddress.TryParse(config.Host, out var address))
              {
                  ipAddresses.Add(address);
              }
              else
              {
                  ipAddresses.Add(IPAddress.IPv6Any);
              }
  
              foreach (var address in ipAddresses)
              {
                  options.Listen(address, port,
                      listenOptions =&gt;
                      {
                          if (config.Scheme == "https")
                          {
                              var certificate = LoadCertificate(config, environmentService);
                              listenOptions.UseHttps(certificate);
                          }
                      });
              }
          }
      }
  
  WebHost.CreateDefaultBuilder(args)
  .UseKestrel(options =&gt; options.ConfigureKestrelServerOptions())
  </code></pre>
  
  <p>After that, i added an X509 certificate on Chrome and all https was working fine.</p>
  
  <p>The problem is that now, i want to debug back with http protocol, and for that i supposed that commenting all the lines above should be sufficent, but each time i try to go to URL <em>"<strong>http</strong>://localhost:8080"</em> it redirects to <em>"<strong>https</strong>://localhost/Account/LogIn?ReturnUrl=%2F"</em>.</p>
  
  <p>I've tried to delete Chrome's HSTS for localhost and localhost:8080; an i've tried to execute the server in a different port with no luck.</p>
  
  <p>Any help? Thanks.</p>