In this post, I’ll explain how a request comes into the ASP.NET Core web server and how it returns a response to the browser.
If you are aware of how ASP.NET Core processes a request, you can skip reading this article.
When the user tries to access the URL from a browser, the request is sent to a server which then sends it to our reverse proxy server.
As you can see from the above diagram, we first have the reverse proxy intercepting the request before sending it over to the ASP.NET Core web server. We can use the reverse proxy to increase performance, security, load balancing etc.
The request is now forwarded to the ASP.NET Core Web server. Kestrel is the default built-in web server for ASP.NET Core applications.
The responsibility of the Kestrel is to construct a HttpContext object from the raw request data. This object will have details required to create appropriate response to the request.
After processing the application logic, it will return the response to the web server.
The ASP.NET Core web server will convert the response from the application logic into a raw HTTP response and sends it back to the reverse proxy. The reverse proxy will then send it back to the browser.
A reverse proxy is a proxy that sits in front of the one or more web servers, intercepting the requests.
We don’t want our ASP.NET Core server to handle every type of request from the internet. An example would be if we implement a CDN to server static files when requested for static content, then attacker(s) would target the reverse proxy (in this case the CDN) instead of our server.
Kestrel web server is a cross-platform open-source web server for ASP.NET Core.
Kestrel is based on Libuv library, the same thing used by NODE.js. Kestrel only uses Libuv for asynchronous I/O work and supports running multiple event loops.
The most important reason Microsoft built kestrel is to provide cross-platform web server which does not rely on System.web
and a full version of CLR for bootstrapping the execution environment.
Karthik is a passionate Full Stack developer working primarily on .NET Core, microservices, distributed systems, VUE and JavaScript. He also loves NBA basketball so you might find some NBA examples in his posts and he owns this blog.
In this post, we’ll see how to test gRPC Server applications using different clients. And… Read More
In this post, we'll create a new gRPC project in ASP.NET Core and see what's… Read More
In this blog post, we’ll see how to run dotnet core projects without opening visual… Read More
Programmatically evaluating policies is useful when we want to provide access or hide some data… Read More
We saw how we could set up policy-based authorization in our previous article. In this… Read More
What is policy-based authorization and how to set up policy-based authorization with handlers and policies… Read More
This website uses cookies.