wasAsked.

What is Kestrel, and how is it different from IIS?

Impetus · Role not specified · technical

Published

Year not specified · .NET

Community answers

Posted by wasAsked editorial collection

Kestrel is the cross-platform web server built into ASP.NET Core. IIS is Microsoft's full-featured web server for Windows. They often work together. Kestrel - Included in every ASP.NET Core app and runs on Windows, Linux and macOS. - Lightweight and very fast; supports HTTP/1.1, HTTP/2, HTTP/3, HTTPS and WebSockets. - Can face the internet directly in modern deployments, especially in containers and Kubernetes, though it is often placed behind a reverse proxy or load balancer. - Configured in code or appsettings (endpoints, certificates, limits such as MaxRequestBodySize). IIS (Internet Information Services) - Windows-only, mature web server with features like Windows authentication, process management, application pools, URL rewrite, request filtering, centralised certificate management and hosting many sites on one machine. How they work together ASP.NET Core apps on IIS use the ASP.NET Core Module (ANCM): - In-process hosting (the default): the app runs inside the IIS worker process (w3wp.exe) using IIS HTTP Server instead of Kestrel, which gives the best performance on IIS. - Out-of-process hosting: IIS acts as a reverse proxy and forwards requests to a Kestrel process. Comparison points for an interview: - Platform: Kestrel is cross-platform; IIS is Windows only. - Role: Kestrel is the application's web server; IIS is a general hosting platform and can be a reverse proxy. - Features: IIS offers management features (app pools, Windows auth, multi-site hosting); Kestrel focuses on speed and simplicity. - Deployment: containers and Linux use Kestrel, often behind Nginx, YARP, Azure Front Door or a Kubernetes ingress; Windows servers commonly use IIS with ANCM. When Kestrel sits behind a proxy, configure forwarded headers (UseForwardedHeaders) so the app sees the original scheme and client IP for redirects, logging and rate limiting.

Ravindra Wadile · · 0 likes

Sign in to add your answer

Related interview topics