Explain about the Hosting Models in ASP.NET Core
There are 2 types of hosting models in ASP.NET Core:
1. Out-of-process Hosting Model: In Out-of-process hosting models, we can either use the Kestrel server directly as a user request facing server or we can deploy the app into IIS which will act as a proxy server and send requests to the internal Kestrel server. In this type of hosting model, we have two options:
a) Using Kestrel: Kestrel is a cross-platform web server for ASP.NET Core. Kestrel is the webserver that's included by default in ASP.NET Core project templates. Kestrel itself acts as an edge server that directly server user requests. It means that we can only use the Kestrel server for our application.
b) Using a Proxy Server: Due to the limitations of the Kestrel server, we cannot use this in all the apps. In such cases, we have to use powerful servers like IIS, NGINX, or Apache. So, in that case, this server acts as a reserve proxy server which redirects every request to the internal Kestrel sever where our app is running. Here, two servers are running. One is IIS and another is Kestrel.
2. In-process Hosting Model: In this type, only one server is used for hosting like IIS, Nginx, or Linux. It means that the App is directly hosted inside of IIS. No Kestrel server is being used. IIS HTTP Server (IISHttpServer) is used instead of the Kestrel server to host apps in IIS directly.
Comments
Post a Comment