Self Hosting Options in AspNetCore - egnomerator/misc GitHub Wiki

ASP.NET Core Self-Hosting

The Options

There Are two main self hosting options in ASP.NET Core

  1. HTTP.sys (if v2 or later)
  2. Kestrel

Differences

The links in the above "options" section provide information about each different option which can help show the differences between HTTP.sys and Kestrel.

Also, the differences are nicely explained in this SO answer.

My Personal takeaway:

  • Use Kestrel if you need to develop cross-platform
  • Use HTTP.sys (of WebListener if pre-v2) if you are developing Windows only

Helpful differentiating information:

HTTP.sys

  • HTTP.sys is Windows specific (cannot use this for cross-platform)
  • HTTP.sys is the same technology IIS uses
    • is feature rich
    • has built-in protection against various attacks

Kestrel

  • supports cross-platform development
  • designed to be run behind a reverse proxy
    • like IIS or NGINX or Apache on Linux
  • should not be deployed directly exposing app to the internet
    • doesn't have comparable built-in defences that HTTP.sys has
    • hence run behind a reverse proxy
  • not as feature rich as IIS

Reverse proxy, what's that?!

  • NGINX provides this nice explanation

A proxy server is a go‑between or intermediary server that forwards requests for content from multiple clients to different servers across the Internet. A reverse proxy server is a type of proxy server that typically sits behind the firewall in a private network and directs client requests to the appropriate backend server. A reverse proxy provides an additional level of abstraction and control to ensure the smooth flow of network traffic between clients and servers.

⚠️ **GitHub.com Fallback** ⚠️