title: How can I solve a request timeout when trying to access an ASP.NET Core 3.1 Web API hosted on a server
body: <p>I wrote an ASP.NET Core 3.1 Web API and hosted it in IIS on my machine and it seems to work fine when testing it with Postman and even accessing it on the browser.</p>
  <p>I then proceeded to host it on the server that runs on Windows Server 2012 and when I try to access it with Postman, I get a request timeout error. I did some research and made some changes to the <code>startup.cs</code> file to increase the solutions timeout as shown below:</p>
  <pre><code> public static IHostBuilder CreateHostBuilder(string[] args) =&gt;
          Host.CreateDefaultBuilder(args)
              .ConfigureWebHostDefaults(webBuilder =&gt;
              {
                  webBuilder.UseStartup&lt;Startup&gt;();
                  webBuilder.ConfigureKestrel(options =&gt;
                  {
                      options.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(10);
                  });
              });
  </code></pre>
  <p>I even added a <code>web.config</code> file to the solution and changed its &quot;Copy to Output Directory&quot; value to &quot;always&quot;.</p>
  <p>The <code>web.config</code> looks like this:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;configuration&gt;
      &lt;system.webServer&gt;
          &lt;handlers&gt;
              &lt;remove name=&quot;aspNetCore&quot; /&gt;
              &lt;add name=&quot;aspNetCore&quot; path=&quot;*&quot; verb=&quot;*&quot; 
                   modules=&quot;AspNetCoreModuleV2&quot; 
                   resourceType=&quot;Unspecified&quot; /&gt;
          &lt;/handlers&gt;
          &lt;aspNetCore requestTimeout=&quot;00:10:00&quot; 
                 processPath=&quot;%LAUNCHER_PATH%&quot; arguments=&quot;%LAUNCHER_ARGS%&quot; 
                 stdoutLogEnabled=&quot;false&quot; stdoutLogFile=&quot;.\logs\stdout&quot;  
                 hostingModel=&quot;InProcess&quot; /&gt;
      &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p>@Lex Li i did run the dotnet publish and i got the below web.config but still i cant access it on postman or the web browser</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;configuration&gt;
    &lt;!-- To customize the asp.net core module uncomment and edit the following section. 
    For more info see https://go.microsoft.com/fwlink/?linkid=838655 --&gt;
    &lt;system.webServer&gt;
      &lt;handlers&gt;
        &lt;remove name=&quot;aspNetCore&quot; /&gt;
        &lt;add name=&quot;aspNetCore&quot; path=&quot;*&quot; verb=&quot;*&quot; modules=&quot;AspNetCoreModuleV2&quot; resourceType=&quot;Unspecified&quot; /&gt;
      &lt;/handlers&gt;
      &lt;aspNetCore requestTimeout=&quot;00:10:00&quot; processPath=&quot;dotnet&quot; arguments=&quot;.\xxxx.dll&quot; stdoutLogEnabled=&quot;false&quot; stdoutLogFile=&quot;.\logs\stdout&quot; hostingModel=&quot;inprocess&quot; /&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/bcPSe.png" rel="nofollow noreferrer">site bindings</a></p>
  <p>I also installed the Windows Server ASP.NET Core Hosting Bundle version 5.0.9 software on the Windows Server 2012, but I am still getting the 2 minute timeout error.</p>
  <p>How can I solve this?</p>