Kestrel is the default cross-platform web server for ASP.NET Core. It receives HTTP traffic, turns raw requests into .NET objects the application can use, and sends responses back to the network. section 1.4.2 section 28.5
For each request, Kestrel creates an HttpContext containing request details and passes it to the application. The request moves through the middleware pipeline, where application components can handle it and produce a response. The response then travels back through the pipeline to the server. section 3.1
Figure 3.1 An overview of an ASP.NET Core application. The ASP.NET Core application receives an incoming HTTP request from the browser. Every request passes to the middleware pipeline, which potentially modifies it and then passes it to the endpoint middleware at the end of the pipeline to generate a response. The response passes back through the middleware to the server and finally out to the browser.
Follow a request from the browser through the server and middleware pipeline, and see how the response returns. section 3.1
An ASP.NET Core application typically runs Kestrel inside its own process. Kestrel can receive requests directly from the internet, or a reverse proxy can receive them first and forward them to the application. A proxy such as IIS, NGINX, or Apache can provide security and performance benefits; the same application can run in different hosting environments without modification. section 2.4.2 section 27.1
HTTPS in production
To serve HTTPS directly with Kestrel, configure a production certificate in Kestrel:Certificates:Default. Kestrel loads it automatically at startup, without application code changes. Alternatively, a reverse proxy can handle HTTPS with the browser; with TLS offloading, traffic between the proxy and application is unencrypted. A development certificate is suitable for local testing, not production. section 28.5

