public void Configure(IApplicationBuilder app) { System.Net.ServicePointManager.DefaultConnectionLimit = 1024; ConfigurationBinder.Bind(Configuration.GetSection("ImageServer"), Conf); app.UseOwin(buildFunc => { buildFunc(next => RequestId.Middleware(next)); buildFunc(next => SizeConstraints.Middleware(next)); buildFunc(next => RequestLogging.Middleware(next, Log)); buildFunc(next => PerformanceLogging.Middleware(next, Log)); buildFunc(next => new MonitoringMiddleware(next, HealthCheckAsync).InvokeAsync); buildFunc.UseNancy(opt => opt.Bootstrapper = new Bootstrapper(Conf, Log, httpClient)); }); }