title: Defining main page using OWIN static files
body: <p>I have a self-hosted app with the help of OWIN. Also, I need to serve some static files. It works but recently I faced a problem - default files stopped working. I mean earlier if you go to localhost it would redirect you to "main" page. But now the main page is only accessible with the direct path e.g. <a href="https://localhost:4443/index.html" rel="nofollow noreferrer">https://localhost:4443/index.html</a><br>
  Here is my Startup method:</p>
  
  <pre><code>public class Startup
  {
  
      // This code configures Web API. The Startup class is specified as a type
      // parameter in the WebApp.Start method.
      public void Configuration(IAppBuilder appBuilder)
      {
          try
          {
              appBuilder.UseOAuthAuthorizationServer(new OAuthOptions());
              appBuilder.UseJwtBearerAuthentication(new JwtOptions());
  
              var config = new MyHttpsSelfHostConfiguration("https://localhost:4443");
  
              var start = DateTime.Now;
  
              config.MapHttpAttributeRoutes();
              var jsonFormatter = new JsonMediaTypeFormatter();
              config.Services.Replace(typeof(IContentNegotiator), new JsonContentNegotiator(jsonFormatter));
  
              config.Routes.MapHttpRoute(
                  name: "WebLabApp",
                  routeTemplate: "api/{controller}/{action}/{id}"
              );
  
              ConfigureUnity(config);
              appBuilder.UseWebApi(config);
  
  
  
              Console.WriteLine($"Configure Unity in {DateTime.Now - start}");
              start = DateTime.Now;
  
              BusinessServicesHostLibrary.ContainerRegistry.RegisterAllBusinessServicesCommonClassesAndConnectionFactory();
              Console.WriteLine($"Register all in {DateTime.Now - start}");
              #if DEBUG
              var contentDir = Directory.GetParent(Directory.GetCurrentDirectory()).Parent?.FullName;
              #else
              var contentDir = @".";
              #endif
              var fileSystem = new PhysicalFileSystem(contentDir);
              var options = new FileServerOptions
              {
                  EnableDefaultFiles = true,
                  DefaultFilesOptions = { DefaultFileNames = { "index.html" } },
                  FileSystem = fileSystem,
              };
              options.StaticFileOptions.FileSystem = fileSystem;
              options.StaticFileOptions.ServeUnknownFileTypes = true;
              appBuilder.UseFileServer(options);
              config.EnsureInitialized();
          }
          catch (Exception ex)
          {
              if (ex is System.Reflection.ReflectionTypeLoadException)
              {
                  var typeLoadException = ex as ReflectionTypeLoadException;
                  var loaderExceptions = typeLoadException.LoaderExceptions;
                  foreach (var x in loaderExceptions) Console.WriteLine(x);
              }
              throw;
          }
      }
  </code></pre>
  
  <p>What am I doing wrong?</p>