1.nginx前端设置:
nginx.conf 配置文件中 增加
http{
proxy_connect_timeout 1200;
proxy_send_timeout 1200;
proxy_read_timeout 1200;
…
}
2.开发环境webstorm
config目录下index.js文件中增加
proxyTable: {
“/hospital”:{
target:“http://localhost:2010/api”,
timeout: 300000,
changeOrigin:true,
pathRewrite:{
“^/hospital”:""
}
}
},
3.服务端.netcore+iis
如果任务执行时间长达 2 分钟 会报502错误
web.config文件中增加
<system.webServer>
<aspNetCore requestTimeout=“00:20:00” … />
</system.webServer>
nginx超时设置
最新推荐文章于 2025-07-10 17:05:38 发布
本文介绍了如何通过调整nginx、webstorm和.NET Core+iIS的配置参数来应对长时间任务导致的502错误。在nginx中设置了代理连接、发送和读取的超时时间,在webstorm的开发环境中配置了代理表以延长请求超时时间,并在.NET Core的web.config文件中设置了请求超时为20分钟。


173

被折叠的 条评论
为什么被折叠?



