liveBook · Manning

Kestrel

As explained in ASP.NET Core in Action, 3e

Kestrel is the cross-platform web server included with ASP.NET Core for receiving and sending HTTP traffic.

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.
CH03_F01_Lock3

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

How ASP.NET Core in Action, 3e covers it

How deep it goes
Explains request flow, hosting options, and certificate configuration, but does not describe obtaining a production certificate.
Examples
Uses a company information web app and a production HTTPS certificate configuration to illustrate Kestrel’s role.
What you can do after
Operate/configure Kestrel with a production HTTPS certificate and evaluate direct hosting against reverse-proxy deployment.
How it connects
Connects HTTP requests to HttpContext, middleware, reverse proxies, and HTTPS.

Also explained in

Compare how 2 books explain Kestrel →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.