简体   繁体   English

Kestrel + IIS反向代理请求未被触发

[英]Kestrel + IIS Reverse Proxy RequestAborted Not Triggered

We have an ASP.NET Core 2.x Application that implements custom middleware that acts as a proxy in front of another (Java based) server/application. 我们有一个ASP.NET Core 2.x应用程序,它实现了自定义中间件,它充当另一个(基于Java)服务器/应用程序的代理。 It is common for the clients of this application/middleware to frequently abort/cancel their request before the server request has completed. 此应用程序/中间件的客户端在服务器请求完成之前经常中止/取消其请求是很常见的。

We've deployed this application to IIS (as a reverse proxy) and running on Kestrel. 我们已将此应用程序部署到IIS(作为反向代理)并在Kestrel上运行。 Prior to Core 2.x Kestrel had a bug that caused HttpContext.RequestAborted to always be false (other related question here )...which was apparently fixed in 2.x (which I've been able to confirm). 在Core 2.x之前,Kestrel有一个错误,导致HttpContext.RequestAborted始终为false这里有其他相关问题)......这显然是在2.x中固定的(我已经能够确认)。

However, it appears that when running IIS in front of Kestrel, it doesn't forward the request abort through to Kestrel and RequestAborted is still always false 但是,似乎在Kestrel前运行IIS时,它不会将请求中止转发到Kestrel,而RequestAborted 仍然总是为false

Is there any way to get RequestAborted working in this configuration (or any other way to detect it if not)? 有没有办法让RequestAborted在此配置中工作(或者如果没有,还有其他任何方式来检测它)?

Simple reproduction repo: https://github.com/mikeomeara1/RequestAbortRepro 简单的复制回购: https//github.com/mikeomeara1/RequestAbortRepro

UPDATE UPDATE

This Comment seems to indicate a known issue but it's largely unclear to what extent 这篇评论似乎表明了一个已知的问题,但在很大程度上还不清楚

This Question seems to also be related but again it's not completely apparent to me that it's directly related (at least it isn't spelled out in such terms). 这个问题似乎也是相关的,但对我而言,它并不是完全明显的,它直接相关(至少它没有用这样的术语拼写)。

@spender - If I understood you correctly, the header comparison is here . @spender - 如果我理解正确,标题比较就在这里 If not, let me know, I'll get you whatever you want to see. 如果没有,请告诉我,我会告诉你任何你想看的东西。

It seems the tea leaves are indicating a known issue. 茶叶似乎表明了一个已知的问题。 So, the question is; 所以,问题是; Is there a way to work around this? 有办法解决这个问题吗? We just went through (a very painful) 1.1 to 2.x upgrade in the hopes this issue would be addressed and letting our server thrash for another month/quarter/year has us pretty concerned at this point. 我们刚刚经历了(一次非常痛苦的)1.1到2.x升级,希望这个问题得到解决,让我们的服务器闯入另一个月/季度/年让我们非常关注这一点。 The system we're working on is greatly scaling up in volume. 我们正在研究的系统在数量上大大增加。

So, any workarounds, hacks or crazy ideas are welcome. 因此,欢迎任何变通方法,黑客或疯狂的想法。

This is known issue and isn't fixed yet. 这是已知问题,尚未修复。 See https://github.com/aspnet/AspNetCoreModule/issues/38 请参阅https://github.com/aspnet/AspNetCoreModule/issues/38

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM