FrozenHeart FrozenHeart - 3 months ago 36
ASP.NET (C#) Question

"Server" response header for Kestrel behind IIS

If I host my Kestrel-based ASP.NET Core website with

behind IIS, should the
response header still say that I'm using Kestrel? Because it seems that it is:

enter image description here

Is it a correct behavior?


Short answer: Yes, it should still report the application as hosted by Kestrel.

When you use IIS to host an ASP.NET Core application, you're really using IIS as a reverse proxy to Kestrel. This is the approach recommended by the documentation:

If you intend to deploy your application on a Windows server, you should run IIS as a reverse proxy server that manages and proxies requests to Kestrel.

An incoming request will be handled first by IIS, and then passed on to Kestrel, like this:

Web -> IIS -> ASP.NET Core module -> Kestrel

So it's still accurate to say that Kestrel is the server handling the request. IIS is just sitting in front, helping Kestrel deal with the incoming traffic. You can check whether the site has been set up and assigned to an app pool in the IIS Manager if you want to determine whether it's using IIS (which should be the default).