When comparing Nginx vs Kestrel, the Slant community recommends Nginx for most people. In the question“What are the best HTTP servers for .NET applications?” Nginx is ranked 1st while Kestrel is ranked 3rd.
Ranked in these QuestionsQuestion Ranking
Pro Highly efficient memory use
Pro Fast and built for scalability
Nginx is event-driven, asynchronous, non-blocking and single threaded (one master process + worker processes). This allows nginx to be manage resources more efficiently compared to thread-based models (like Apache).
Nginx offers a more basic set of functions out of the box compared most web servers. Extra functionality can be added via modules.
Pro Highly efficient CPU use
Pro Free and open source
Pro Advanced load balancing and caching
Pro Event Based Request Handling
Does not fork/thread per request.
Pro Easily configurable
Configuration files are concise and simple.
Pro Good option for internal servers
Kestrel itself is fast, but lacking in security and general features. This makes running Kestrel on its own a good option for servers that are only going to be accessed internally.
Pro Integrated with Visual Studio
When you make a new project in VS, the project is automatically configured to work with Kestrel.
Pro Cross Platform
Kestrel's initial goal was to find a way to get ASP.NET running on Linux. Developers can deploy their .NET app on either Windows or Linux, and Kestrel can be present on either one.
Pro Built to be very fast, and it is
Kestrel is built to be fast.
When tested on Windows Server 2012 against IIS and at a pipeline depth of 16, Kestrel pushed 1,188,521 requests per second compared to IIS' 57,792 requests per second.
You can read the official benchmark here
Con Due to security concerns, external use requires a reverse proxy in front of it
Kestrel is fairly new and doesn't yet have the full suite of security features that you might find in a more mature server. It's recommended to run IIS, Nginx, or Apache in front of it set as a reverse proxy to handle incoming connections. The connections are then passed off to Kestrel after preliminary handling. Because of Kestrels young age, it doesn't have a full defense against attacks which includes, but isn't limited to, appropriate timeouts, size limits, and concurrent connection limits.
Con Lacking in features
Kestrel was built to be fast, so the developers had to cut out some of the higher tier features. Kestrel was designed to push requests and that's it, so if you want additional features it's recommended to run a full-fledged web server in front of it.
You can see a full feature list in the specs section of this recommendation.