从 IIS 上的 ASP.NET Core 应用程序请求超时 [英] Request timeout from ASP.NET Core app on IIS

查看:40
本文介绍了从 IIS 上的 ASP.NET Core 应用程序请求超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从我的 ASP.NET Core 应用程序向第三方 API 发出 Web 请求.

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

  1. 当应用单独运行时,请求成功.
  2. 当应用在同一台服务器上的 IIS 中运行时,请求超时.

通过 RestSharp 客户端从 Hangfire 循环作业向 Asana API 端点 (HTTPS) 发出请求.自己app的所有页面都可以通过IIS访问,但是app不能发出任何请求.

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?

推荐答案

IIS 的行为是由 web.config 驱动的,我已经配置为处理请求 <指定 requestTimeout="00:20:00" 的 20 分钟:

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=".logsstdout"
  forwardWindowsAuthToken="false">
  <environmentVariables>
    <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="staging" /> <!-- value could be "development", "staging" or "production"-->
  </environmentVariables>
</aspNetCore>

这篇关于从 IIS 上的 ASP.NET Core 应用程序请求超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆