Request timeout from ASP.NET Core app on IIS

浪子不回头ぞ 提交于 2020-01-11 04:48:11

问题


I make a web request to a third-party api from my ASP.NET Core application.

  1. When app is running alone itself, request succeeds.
  2. When app is running in IIS on the same server, request timeouts.

Request is made from a Hangfire recurring job to Asana API endpoint (HTTPS) via RestSharp client. All the own app's pages are available through IIS, but app cannot make any requests.

Where should I look and what to debug to solve this problem?


回答1:


IIS behavior is driven by the web.config, I have configured to deal with request < 20 min specifying requestTimeout="00:20:00":

<aspNetCore
  requestTimeout="00:20:00"
  processPath="%LAUNCHER_PATH%"
  arguments="%LAUNCHER_ARGS%"
  stdoutLogEnabled="false"
  stdoutLogFile=".\logs\stdout"
  forwardWindowsAuthToken="false">
  <environmentVariables>
    <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="staging" /> <!-- value could be "development", "staging" or "production"-->
  </environmentVariables>
</aspNetCore>


来源:https://stackoverflow.com/questions/43097433/request-timeout-from-asp-net-core-app-on-iis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!