iis - 错误网关 = IIS 平台超时与 python 女服务员
问题描述
由于 2 分钟的超时,我得到了一个错误的网关,但我现在不知道如何配置它,以下是我尝试过的。
所以,首先,在python中我设置了一个120秒的超时(我不想改变这个,我已经尝试了115秒并且它工作但我想解决来自IIS或女服务员的外部超时,我不想在我的内部软件中更改此限制)。
try:
# ...
req = http.request("POST", url = url, timeout=120, body = body, headers=headers)
# ...
except urllib3.exceptions.RequestError as exc:
log.error("reporting exc type %s message %s", type(exc), exc)
return render_template_string("External API is not responding")
我在 Web.config 中设置了这个
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<httpRuntime executionTimeout="200" />
</system.web>
<system.webServer>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform
ETC...
在我的女服务员批次中:
F:
cd F:\Appl\flask
venv\scripts\waitress-serve.exe --channel-timeout=300 --host=127.0.0.1 --port=%1 sample00:app
从 IIS 配置 > 限制我设置了“连接超时(以秒为单位):”200
解决方案
最后通过添加web.configrequestTimeout="00:05:00"
的标签来解决httpPlatform
推荐阅读
- python-3.x - 尝试按字符分隔列表中的项目但输出多次返回
- laravel-5.7 - 重新初始化应用程序 laravel
- java - selenium webdriver(JAVA)中来自gmail帐户的电子邮件验证
- yii2 - Yii2 - 一次从不同模块加载夹具
- c# - 如何根据剑道中另一列中的值禁用内联编辑中的字段?
- laravel - 在 Laravel 应用程序中,我在运行项目文件夹时返回 phpinfo()
- python - 在 XQuery 中的 FLOWR 中
- javascript - 如何在 ReactJS 中正确检测鼠标滚轮
- c++ - 重新计算规则网格表面的法线 (C++/OpenGL)
- python - 更一致的狮身人面像主题