My situation is the following: I have an ASP.NET Core REST API using Kestrel reverse proxied over IIS (through AspNetCoreModule). On a special endpoint (required by a hardware device) I send a 'Connection: close'-HTTP header. On all other endpoints I don't send this header. So when I start the REST API in standalone mode (without IIS) everything is working as expected. But as soon as I run it over IIS, IIS doesn't forward the Connection header although all other headers are forwarded correctly. Disabling keep-alive for all endpoints is not an option. What I have tried so far is installing the rewrite module for IIS and creating an outbound rule with it matching the Connection header set to close and reset it on a match. It seems IIS ignores the RESPONSE_Connection and HTTP_CONNECTION server variables (I have tried other headers with the same rule and it worked).
The best solution would be without even installing the rewrite module. Thanks in advance for any solutions.