Code for Heaven

Start from scratch, then reach the skies


Kestrel is a webserver included by default as one of fundamentals of ASP.NET Core framework. It provides additional layer in communication between Internet and Application. WIth Kestrel, ASP Core applications doesn't require any other server like IIS, Nginx or Apache, though it's still applicable. And sometimes necessary, because Kestrel doesn't support sharing the same IP and port between multiple processes.

As MSDN provides, it is also considerable due to following arguments:

  • It can limit your exposed surface area.
  • It provides an optional additional layer of configuration and defense.
  • It might integrate better with existing infrastructure.
  • It simplifies load balancing and SSL set-up. Only your reverse proxy server requires an SSL certificate, and that server can communicate with your application servers on the internal network using plain HTTP.

To illustrate the change between Core and MVC, please, take a look at the infographic below:

Now, Kestrel runs a loop in which it listens to HTTP requests (it's called event-driven style of programming) from either Internet or proxy server (where the request can be pre-processed) and forwards them under the wrapping of HttpContext. This additional layer between Internet and application makes it possible to run the latter on any kind of base server. Using Kestrel as an in-process server simplifies startup configuration and makes this process consistent across different platforms.

Leave a Reply

Your email address will not be published. Required fields are marked *