You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/servers/index.md
+25-83Lines changed: 25 additions & 83 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,10 @@
2
2
title: Web server implementations in ASP.NET Core
3
3
author: guardrex
4
4
description: Discover the web servers Kestrel and HTTP.sys for ASP.NET Core. Learn how to choose a server and when to use a reverse proxy server.
5
+
monikerRange: '>= aspnetcore-2.1'
5
6
ms.author: tdykstra
6
7
ms.custom: mvc
7
-
ms.date: 05/24/2019
8
+
ms.date: 06/01/2019
8
9
uid: fundamentals/servers/index
9
10
---
10
11
# Web server implementations in ASP.NET Core
@@ -13,63 +14,48 @@ By [Tom Dykstra](https://github.com/tdykstra), [Steve Smith](https://ardalis.com
13
14
14
15
An ASP.NET Core app runs with an in-process HTTP server implementation. The server implementation listens for HTTP requests and surfaces them to the app as a set of [request features](xref:fundamentals/request-features) composed into an <xref:Microsoft.AspNetCore.Http.HttpContext>.
15
16
16
-
::: moniker range=">= aspnetcore-2.2"
17
-
18
-
# [Windows](#tab/windows)
19
-
20
-
ASP.NET Core ships with the following:
21
-
22
-
*[Kestrel server](xref:fundamentals/servers/kestrel) is the default, cross-platform HTTP server implementation.
23
-
* IIS HTTP Server is an [in-process server](#in-process-hosting-model) for IIS.
24
-
*[HTTP.sys server](xref:fundamentals/servers/httpsys) is a Windows-only HTTP server based on the [HTTP.sys kernel driver and HTTP Server API](/windows/desktop/Http/http-api-start-page).
25
-
26
-
When using [IIS](/iis/get-started/introduction-to-iis/introduction-to-iis-architecture) or [IIS Express](/iis/extensions/introduction-to-iis-express/iis-express-overview), the app either runs:
27
-
28
-
* In the same process as the IIS worker process (the [in-process hosting model](#in-process-hosting-model)) with the [IIS HTTP Server](#iis-http-server). *In-process* is the recommended configuration.
29
-
* In a process separate from the IIS worker process (the [out-of-process hosting model](#out-of-process-hosting-model)) with the [Kestrel server](#kestrel).
30
-
31
-
The [ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module) is a native IIS module that handles native IIS requests between IIS and the in-process IIS HTTP Server or Kestrel. For more information, see <xref:host-and-deploy/aspnet-core-module>.
17
+
## Kestrel
32
18
33
-
## Hosting models
19
+
Kestrel is the default web server included in ASP.NET Core project templates.
34
20
35
-
### In-process hosting model
21
+
Use Kestrel:
36
22
37
-
Using in-process hosting, an ASP.NET Core app runs in the same process as its IIS worker process. In-process hosting provides improved performance over out-of-process hosting because requests aren't proxied over the loopback adapter, a network interface that returns outgoing network traffic back to the same machine. IIS handles process management with the [Windows Process Activation Service (WAS)](/iis/manage/provisioning-and-managing-iis/features-of-the-windows-process-activation-service-was).
23
+
* By itself as an edge server processing requests directly from a network, including the Internet.
38
24
39
-
The ASP.NET Core Module:
25
+

40
26
41
-
* Performs app initialization.
42
-
* Loads the [CoreCLR](/dotnet/standard/glossary#coreclr).
43
-
* Calls `Program.Main`.
44
-
* Handles the lifetime of the IIS native request.
27
+
* With a *reverse proxy server*, such as [Internet Information Services (IIS)](https://www.iis.net/), [Nginx](http://nginx.org), or [Apache](https://httpd.apache.org/). A reverse proxy server receives HTTP requests from the Internet and forwards them to Kestrel.
45
28
46
-
The in-process hosting model isn't supported for ASP.NET Core apps that target the .NET Framework.
29
+

47
30
48
-
The following diagram illustrates the relationship between IIS, the ASP.NET Core Module, and an app hosted in-process:
31
+
Either hosting configuration—with or without a reverse proxy server—is supported for ASP.NET Core 2.1 or later apps.
For Kestrel configuration guidance and information on when to use Kestrel in a reverse proxy configuration, see <xref:fundamentals/servers/kestrel>.
51
34
52
-
A request arrives from the web to the kernel-mode HTTP.sys driver. The driver routes the native request to IIS on the website's configured port, usually 80 (HTTP) or 443 (HTTPS). The module receives the native request and passes it to IIS HTTP Server (`IISHttpServer`). IIS HTTP Server is an in-process server implementation for IIS that converts the request from native to managed.
35
+
::: moniker range=">= aspnetcore-2.2"
53
36
54
-
After the IIS HTTP Server processes the request, the request is pushed into the ASP.NET Core middleware pipeline. The middleware pipeline handles the request and passes it on as an `HttpContext` instance to the app's logic. The app's response is passed back to IIS through IIS HTTP Server. IIS sends the response to the client that initiated the request.
37
+
# [Windows](#tab/windows)
55
38
56
-
In-process hosting is opt-in for existing apps, but [dotnet new](/dotnet/core/tools/dotnet-new) templates default to the in-process hosting model for all IIS and IIS Express scenarios.
39
+
ASP.NET Core ships with the following:
57
40
58
-
### Out-of-process hosting model
41
+
*[Kestrel server](xref:fundamentals/servers/kestrel) is the default, cross-platform HTTP server implementation.
42
+
* IIS HTTP Server is an [in-process server](#hosting-models) for IIS.
43
+
*[HTTP.sys server](xref:fundamentals/servers/httpsys) is a Windows-only HTTP server based on the [HTTP.sys kernel driver and HTTP Server API](/windows/desktop/Http/http-api-start-page).
59
44
60
-
Because ASP.NET Core apps run in a process separate from the IIS worker process, the module handles process management. The module starts the process for the ASP.NET Core app when the first request arrives and restarts the app if it shuts down or crashes. This is essentially the same behavior as seen with apps that run in-process that are managed by the [Windows Process Activation Service (WAS)](/iis/manage/provisioning-and-managing-iis/features-of-the-windows-process-activation-service-was).
45
+
When using [IIS](/iis/get-started/introduction-to-iis/introduction-to-iis-architecture) or [IIS Express](/iis/extensions/introduction-to-iis-express/iis-express-overview), the app either runs:
61
46
62
-
The following diagram illustrates the relationship between IIS, the ASP.NET Core Module, and an app hosted out-of-process:
47
+
* In the same process as the IIS worker process (the [in-process hosting model](#hosting-models)) with the IIS HTTP Server. *In-process* is the recommended configuration.
48
+
* In a process separate from the IIS worker process (the [out-of-process hosting model](#hosting-models)) with the [Kestrel server](#kestrel).
The [ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module) is a native IIS module that handles native IIS requests between IIS and the in-process IIS HTTP Server or Kestrel. For more information, see <xref:host-and-deploy/aspnet-core-module>.
65
51
66
-
Requests arrive from the web to the kernel-mode HTTP.sys driver. The driver routes the requests to IIS on the website's configured port, usually 80 (HTTP) or 443 (HTTPS). The module forwards the requests to Kestrel on a random port for the app, which isn't port 80 or 443.
52
+
## Hosting models
67
53
68
-
The module specifies the port via an environment variable at startup, and the <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderIISExtensions.UseIISIntegration*> extension configures the server to listen on `http://localhost:{PORT}`. Additional checks are performed, and requests that don't originate from the module are rejected. The module doesn't support HTTPS forwarding, so requests are forwarded over HTTP even if received by IIS over HTTPS.
54
+
Using in-process hosting, an ASP.NET Core app runs in the same process as its IIS worker process. In-process hosting provides improved performance over out-of-process hosting because requests aren't proxied over the loopback adapter, a network interface that returns outgoing network traffic back to the same machine. IIS handles process management with the [Windows Process Activation Service (WAS)](/iis/manage/provisioning-and-managing-iis/features-of-the-windows-process-activation-service-was).
69
55
70
-
After Kestrel picks up the request from the module, the request is pushed into the ASP.NET Core middleware pipeline. The middleware pipeline handles the request and passes it on as an `HttpContext` instance to the app's logic. Middleware added by IIS Integration updates the scheme, remote IP, and pathbase to account for forwarding the request to Kestrel. The app's response is passed back to IIS, which pushes it back out to the HTTP client that initiated the request.
56
+
Using out-of-process hosting, ASP.NET Core apps run in a process separate from the IIS worker process, and the module handles process management. The module starts the process for the ASP.NET Core app when the first request arrives and restarts the app if it shuts down or crashes. This is essentially the same behavior as seen with apps that run in-process that are managed by the [Windows Process Activation Service (WAS)](/iis/manage/provisioning-and-managing-iis/features-of-the-windows-process-activation-service-was).
71
57
72
-
For IIS and ASP.NET Core Module configuration guidance, see the following topics:
58
+
For more information and configuration guidance, see the following topics:
73
59
74
60
*<xref:host-and-deploy/iis/index>
75
61
*<xref:host-and-deploy/aspnet-core-module>
@@ -126,42 +112,6 @@ ASP.NET Core ships with [Kestrel server](xref:fundamentals/servers/kestrel), whi
126
112
127
113
::: moniker-end
128
114
129
-
## Kestrel
130
-
131
-
Kestrel is the default web server included in ASP.NET Core project templates.
132
-
133
-
::: moniker range=">= aspnetcore-2.0"
134
-
135
-
Kestrel can be used:
136
-
137
-
* By itself as an edge server processing requests directly from a network, including the Internet.
138
-
139
-

140
-
141
-
* With a *reverse proxy server*, such as [Internet Information Services (IIS)](https://www.iis.net/), [Nginx](http://nginx.org), or [Apache](https://httpd.apache.org/). A reverse proxy server receives HTTP requests from the Internet and forwards them to Kestrel.
142
-
143
-

144
-
145
-
Either hosting configuration—with or without a reverse proxy server—is supported for ASP.NET Core 2.1 or later apps.
146
-
147
-
::: moniker-end
148
-
149
-
::: moniker range="< aspnetcore-2.0"
150
-
151
-
If the app only accepts requests from an internal network, Kestrel can be used by itself.
152
-
153
-

154
-
155
-
If the app is exposed to the Internet, Kestrel must use a *reverse proxy server*, such as [Internet Information Services (IIS)](https://www.iis.net/), [Nginx](http://nginx.org), or [Apache](https://httpd.apache.org/). A reverse proxy server receives HTTP requests from the Internet and forwards them to Kestrel.
156
-
157
-

158
-
159
-
The most important reason for using a reverse proxy for public-facing edge server deployments that are exposed directly the Internet is security. The 1.x versions of Kestrel don't include important security features to defend against attacks from the Internet. This includes, but isn't limited to, appropriate timeouts, request size limits, and concurrent connection limits.
160
-
161
-
::: moniker-end
162
-
163
-
For Kestrel configuration guidance and information on when to use Kestrel in a reverse proxy configuration, see <xref:fundamentals/servers/kestrel>.
164
-
165
115
### Nginx with Kestrel
166
116
167
117
For information on how to use Nginx on Linux as a reverse proxy server for Kestrel, see <xref:host-and-deploy/linux-nginx>.
@@ -170,14 +120,6 @@ For information on how to use Nginx on Linux as a reverse proxy server for Kestr
170
120
171
121
For information on how to use Apache on Linux as a reverse proxy server for Kestrel, see <xref:host-and-deploy/linux-apache>.
172
122
173
-
::: moniker range=">= aspnetcore-2.2"
174
-
175
-
## IIS HTTP Server
176
-
177
-
IIS HTTP Server is an [in-process server](#in-process-hosting-model) for IIS and required for in-process deployments. The [ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module) handles native IIS requests between IIS and IIS HTTP Server. For more information, see <xref:host-and-deploy/aspnet-core-module>.
178
-
179
-
::: moniker-end
180
-
181
123
## HTTP.sys
182
124
183
125
If ASP.NET Core apps are run on Windows, HTTP.sys is an alternative to Kestrel. Kestrel is generally recommended for best performance. HTTP.sys can be used in scenarios where the app is exposed to the Internet and required capabilities are supported by HTTP.sys but not Kestrel. For more information, see <xref:fundamentals/servers/httpsys>.
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/servers/kestrel.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn about Kestrel, the cross-platform web server for ASP.NET Core
5
5
monikerRange: '>= aspnetcore-2.1'
6
6
ms.author: tdykstra
7
7
ms.custom: mvc
8
-
ms.date: 05/17/2019
8
+
ms.date: 05/28/2019
9
9
uid: fundamentals/servers/kestrel
10
10
---
11
11
# Kestrel web server implementation in ASP.NET Core
@@ -279,7 +279,7 @@ You can override the setting on a specific request in middleware:
279
279
280
280
An exception is thrown if you attempt to configure the limit on a request after the app has started to read the request. There's an `IsReadOnly` property that indicates if the `MaxRequestBodySize` property is in read-only state, meaning it's too late to configure the limit.
281
281
282
-
When an app is run [out-of-process](xref:fundamentals/servers/index#out-of-process-hosting-model) behind the [ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module), Kestrel's request body size limit is disabled because IIS already sets the limit.
282
+
When an app is run [out-of-process](xref:host-and-deploy/iis/index#out-of-process-hosting-model) behind the [ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module), Kestrel's request body size limit is disabled because IIS already sets the limit.
Copy file name to clipboardExpand all lines: aspnetcore/host-and-deploy/azure-apps/index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: This article contains links to Azure host and deploy resources.
5
5
monikerRange: '>= aspnetcore-2.1'
6
6
ms.author: riande
7
7
ms.custom: mvc
8
-
ms.date: 03/30/2019
8
+
ms.date: 05/28/2019
9
9
uid: host-and-deploy/azure-apps/index
10
10
---
11
11
# Deploy ASP.NET Core apps to Azure App Service
@@ -74,7 +74,7 @@ When an app uses the [Generic Host](xref:fundamentals/host/generic-host), enviro
74
74
75
75
## Proxy server and load balancer scenarios
76
76
77
-
The [IIS Integration Middleware](xref:host-and-deploy/iis/index#enable-the-iisintegration-components), which configures Forwarded Headers Middleware when hosting [out-of-process](xref:fundamentals/servers/index#out-of-process-hosting-model), and the ASP.NET Core Module are configured to forward the scheme (HTTP/HTTPS) and the remote IP address where the request originated. Additional configuration might be required for apps hosted behind additional proxy servers and load balancers. For more information, see [Configure ASP.NET Core to work with proxy servers and load balancers](xref:host-and-deploy/proxy-load-balancer).
77
+
The [IIS Integration Middleware](xref:host-and-deploy/iis/index#enable-the-iisintegration-components), which configures Forwarded Headers Middleware when hosting [out-of-process](xref:host-and-deploy/iis/index#out-of-process-hosting-model), and the ASP.NET Core Module are configured to forward the scheme (HTTP/HTTPS) and the remote IP address where the request originated. Additional configuration might be required for apps hosted behind additional proxy servers and load balancers. For more information, see [Configure ASP.NET Core to work with proxy servers and load balancers](xref:host-and-deploy/proxy-load-balancer).
0 commit comments