();
-
- app.UseStaticFiles();
-
- app.Run(async (context) =>
- {
- context.Response.ContentType = "text/html";
- await context.Response.WriteAsync("Hosted by Kestrel
");
- // ASPNETCORE_PORT is the port that IIS proxies requests to.
- if (Environment.GetEnvironmentVariable("ASPNETCORE_PORT") != null)
- {
- await context.Response.WriteAsync("Using IIS as reverse proxy.");
- }
- if (serverAddressesFeature != null)
- {
- await context.Response.WriteAsync($"
Listening on the following addresses: {string.Join(", ", serverAddressesFeature.Addresses)}
");
- }
-
- await context.Response.WriteAsync($"
Request URL: {context.Request.GetDisplayUrl()}
");
- });
- }
- }
-}
diff --git a/aspnetcore/fundamentals/servers/aspnet-core-module/sample/appsettings.json b/aspnetcore/fundamentals/servers/aspnet-core-module/sample/appsettings.json
deleted file mode 100644
index fa8ce71a97a3..000000000000
--- a/aspnetcore/fundamentals/servers/aspnet-core-module/sample/appsettings.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "Logging": {
- "IncludeScopes": false,
- "LogLevel": {
- "Default": "Debug",
- "System": "Information",
- "Microsoft": "Information"
- }
- }
-}
diff --git a/aspnetcore/fundamentals/servers/aspnet-core-module/sample/project.json b/aspnetcore/fundamentals/servers/aspnet-core-module/sample/project.json
deleted file mode 100644
index 204d807a4ae4..000000000000
--- a/aspnetcore/fundamentals/servers/aspnet-core-module/sample/project.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "version": "1.0.0-*",
-
- "dependencies": {
- "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
- "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
- "Microsoft.Extensions.Logging.Console": "1.1.0",
- "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
- "Microsoft.Extensions.Configuration.CommandLine": "1.1.0",
- "Microsoft.Extensions.Configuration.Json": "1.1.0",
- "Microsoft.AspNetCore.StaticFiles": "1.1.0"
- },
-
- "tools": {
- "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
- },
-
- "buildOptions": {
- "emitEntryPoint": true
- },
-
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "version": "1.1.0",
- "type": "platform"
- },
- "System.Console": "4.3.0"
- }
- },
- "net451": {}
- },
-
- "publishOptions": {
- "include": [
- "wwwroot",
- "web.config"
- ]
- },
-
- "scripts": {
- "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
- }
-}
diff --git a/aspnetcore/fundamentals/servers/aspnet-core-module/sample/web.config b/aspnetcore/fundamentals/servers/aspnet-core-module/sample/web.config
deleted file mode 100644
index e62e1a101fc8..000000000000
--- a/aspnetcore/fundamentals/servers/aspnet-core-module/sample/web.config
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/aspnetcore/fundamentals/servers/aspnet-core-module/sample/wwwroot/demo.html b/aspnetcore/fundamentals/servers/aspnet-core-module/sample/wwwroot/demo.html
deleted file mode 100644
index fd35dfb041b4..000000000000
--- a/aspnetcore/fundamentals/servers/aspnet-core-module/sample/wwwroot/demo.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- AspNetCoreModuleDemo
-
-
- Hello from static HTML!
-
-
\ No newline at end of file
diff --git a/aspnetcore/fundamentals/static-files.md b/aspnetcore/fundamentals/static-files.md
index 991bf45b3fba..aff7b3dba6b7 100644
--- a/aspnetcore/fundamentals/static-files.md
+++ b/aspnetcore/fundamentals/static-files.md
@@ -233,7 +233,7 @@ With the preceding code, a request for a file with an unknown content type is re
* The URLs for content exposed with `UseDirectoryBrowser` and `UseStaticFiles` are subject to the case sensitivity and character restrictions of the underlying file system. For example, Windows is case insensitive—Mac and Linux aren't.
-* ASP.NET Core apps hosted in IIS use the [ASP.NET Core Module (ANCM)](xref:fundamentals/servers/aspnet-core-module) to forward all requests to the app, including static file requests. The IIS static file handler isn't used. It has no chance to handle requests before they're handled by the ANCM.
+* ASP.NET Core apps hosted in IIS use the [ASP.NET Core Module](xref:fundamentals/servers/aspnet-core-module) to forward all requests to the app, including static file requests. The IIS static file handler isn't used. It has no chance to handle requests before they're handled by the module.
* Complete the following steps in IIS Manager to remove the IIS static file handler at the server or website level:
1. Navigate to the **Modules** feature.
@@ -241,7 +241,7 @@ With the preceding code, a request for a file with an unknown content type is re
1. Click **Remove** in the **Actions** sidebar.
> [!WARNING]
-> If the IIS static file handler is enabled **and** the ANCM is configured incorrectly, static files are served. This happens, for example, if the *web.config* file isn't deployed.
+> If the IIS static file handler is enabled **and** the ASP.NET Core Module is configured incorrectly, static files are served. This happens, for example, if the *web.config* file isn't deployed.
* Place code files (including *.cs* and *.cshtml*) outside of the app project's web root. A logical separation is therefore created between the app's client-side content and server-based code. This prevents server-side code from being leaked.
diff --git a/aspnetcore/host-and-deploy/aspnet-core-module.md b/aspnetcore/host-and-deploy/aspnet-core-module.md
index be78beffc5a1..c5ed76f17eaa 100644
--- a/aspnetcore/host-and-deploy/aspnet-core-module.md
+++ b/aspnetcore/host-and-deploy/aspnet-core-module.md
@@ -124,6 +124,12 @@ The following sample `aspNetCore` element configures `stdout` logging for an app
See [Configuration with web.config](#configuration-with-webconfig) for an example of the `aspNetCore` element in the *web.config* file.
+## Proxy configuration uses HTTP protocol and a pairing token
+
+The proxy created between the ASP.NET Core Module and Kestrel uses the HTTP protocol. Using HTTP is a performance optimization, where the traffic between the module and Kestrel takes place on a loopback address off of the network interface. There's no risk of eavesdropping the traffic between the module and Kestrel from a location off of the server.
+
+A pairing token is used to guarantee that the requests received by Kestrel were proxied by IIS and didn't come from some other source. The pairing token is created and set into an environment variable (`ASPNETCORE_TOKEN`) by the module. The pairing token is also set into a header (`MSAspNetCoreToken`) on every proxied request. IIS Middleware checks each request it receives to confirm that the pairing token header value matches the environment variable value. If the token values are mismatched, the request is logged and rejected. The pairing token environment variable and the traffic between the module and Kestrel aren't accessible from a location off of the server. Without knowing the pairing token value, an attacker can't submit requests that bypass the check in the IIS Middleware.
+
## ASP.NET Core Module with an IIS Shared Configuration
The ASP.NET Core Module installer runs with the privileges of the **SYSTEM** account. Because the local system account doesn't have modify permission for the share path used by the IIS Shared Configuration, the installer hits an access denied error when attempting to configure the module settings in *applicationHost.config* on the share. When using an IIS Shared Configuration, follow these steps:
diff --git a/aspnetcore/host-and-deploy/iis/index.md b/aspnetcore/host-and-deploy/iis/index.md
index 192a263ccfa5..3e5e1bd8add0 100644
--- a/aspnetcore/host-and-deploy/iis/index.md
+++ b/aspnetcore/host-and-deploy/iis/index.md
@@ -40,6 +40,8 @@ public static IWebHost BuildWebHost(string[] args) =>
...
```
+The ASP.NET Core Module generates a dynamic port to assign to the back-end process. The `UseIISIntegration` method picks up the dynamic port and configures Kestrel to listen on `http://locahost:{dynamicPort}/`. This overrides other URL configurations, such as calls to `UseUrls` or [Kestrel's Listen API](xref:fundamentals/servers/kestrel#endpoint-configuration). Therefore, calls to `UseUrls` or Kestrel's `Listen` API aren't required when using the module. If `UseUrls` or `Listen` is called, Kestrel listens on the port specified when running the app without IIS.
+
# [ASP.NET Core 1.x](#tab/aspnetcore1x)
Include a dependency on the [Microsoft.AspNetCore.Server.IISIntegration](https://www.nuget.org/packages/Microsoft.AspNetCore.Server.IISIntegration/) package in the app's dependencies. Use IIS Integration middleware by adding the [UseIISIntegration](/dotnet/api/microsoft.aspnetcore.hosting.webhostbuilderiisextensions.useiisintegration) extension method to [WebHostBuilder](/dotnet/api/microsoft.aspnetcore.hosting.webhostbuilder):
@@ -53,6 +55,10 @@ var host = new WebHostBuilder()
Both [UseKestrel](/dotnet/api/microsoft.aspnetcore.hosting.webhostbuilderkestrelextensions.usekestrel) and [UseIISIntegration](/dotnet/api/microsoft.aspnetcore.hosting.webhostbuilderiisextensions.useiisintegration) are required. Code calling `UseIISIntegration` doesn't affect code portability. If the app isn't run behind IIS (for example, the app is run directly on Kestrel), `UseIISIntegration` doesn't operate.
+The ASP.NET Core Module generates a dynamic port to assign to the back-end process. The `UseIISIntegration` method picks up the dynamic port and configures Kestrel to listen on `http://locahost:{dynamicPort}/`. This overrides other URL configurations, such as calls to `UseUrls`. Therefore, a call to `UseUrls` isn't required when using the module. If `UseUrls` is called, Kestrel listens on the port specified when running the app without IIS.
+
+If `UseUrls` is called in an ASP.NET Core 1.0 app, call it **before** calling `UseIISIntegration` so that the module-configured port isn't overwritten. This calling order isn't required with ASP.NET Core 1.1 because the module setting overrides `UseUrls`.
+
---
For more information on hosting, see [Hosting in ASP.NET Core](xref:fundamentals/hosting).
diff --git a/aspnetcore/security/authentication/windowsauth.md b/aspnetcore/security/authentication/windowsauth.md
index 6196e629ea84..38248642749d 100644
--- a/aspnetcore/security/authentication/windowsauth.md
+++ b/aspnetcore/security/authentication/windowsauth.md
@@ -51,7 +51,7 @@ Alternatively, these two properties can be configured in the *launchSettings.jso
## Enable Windows authentication with IIS
-IIS uses the [ASP.NET Core Module](xref:fundamentals/servers/aspnet-core-module) (ANCM) to host ASP.NET Core apps. The ANCM flows Windows authentication to IIS by default. Configuration of Windows authentication is done within IIS, not the application project. The following sections show how to use IIS Manager to configure an ASP.NET Core app to use Windows authentication.
+IIS uses the [ASP.NET Core Module](xref:fundamentals/servers/aspnet-core-module) to host ASP.NET Core apps. The module flows Windows authentication to IIS by default. Windows authentication is configured in IIS, not the app. The following sections show how to use IIS Manager to configure an ASP.NET Core app to use Windows authentication.
### Create a new IIS site
diff --git a/aspnetcore/tutorials/nano-server.md b/aspnetcore/tutorials/nano-server.md
index d6ffb23c7dd9..3d57bc5b0c09 100644
--- a/aspnetcore/tutorials/nano-server.md
+++ b/aspnetcore/tutorials/nano-server.md
@@ -97,9 +97,9 @@ Install-NanoServerPackage -Name Microsoft-NanoServer-IIS-Package
To quickly verify if IIS is setup correctly, you can visit the URL `http://192.168.1.10/` and should see a welcome page. When IIS is installed, a website called `Default Web Site` listening on port 80 is created by default.
-## Installing the ASP.NET Core Module (ANCM)
+## Install the ASP.NET Core Module
-The ASP.NET Core Module is an IIS 7.5+ module which is responsible for process management of ASP.NET Core HTTP listeners and to proxy requests to processes that it manages. At the moment, the process to install the ASP.NET Core Module for IIS is manual. You will need to install the [.NET Core Windows Server Hosting bundle](https://download.microsoft.com/download/B/1/D/B1D7D5BF-3920-47AA-94BD-7A6E48822F18/DotNetCore.2.0.0-WindowsHosting.exe) on a regular (not Nano) machine. After installing the bundle on a regular machine, you will need to copy the following files to the file share that we created earlier.
+The ASP.NET Core Module is an IIS 7.5+ module which is responsible for process management of ASP.NET Core HTTP listeners and to proxy requests to processes that it manages. At the moment, the process to install the ASP.NET Core Module for IIS is manual. Install the [.NET Core Windows Server Hosting bundle](https://aka.ms/dotnetcore-2-windowshosting) on a regular (not Nano) machine. After installing the bundle on a regular machine, copy the following files to the file share that we created earlier.
On a regular (not Nano) server with IIS, run the following copy commands:
@@ -119,39 +119,7 @@ Copy-Item -Path C:\PublishedApps\AspNetCoreSampleForNano\aspnetcore_schema.xml -
Run the following script in the remote session:
-```PowerShell
-# Backup existing applicationHost.config
-Copy-Item -Path C:\Windows\System32\inetsrv\config\applicationHost.config -Destination C:\Windows\System32\inetsrv\config\applicationHost_BeforeInstallingANCM.config
-
-Import-Module IISAdministration
-
-# Initialize variables
-$aspNetCoreHandlerFilePath="C:\windows\system32\inetsrv\aspnetcore.dll"
-Reset-IISServerManager -confirm:$false
-$sm = Get-IISServerManager
-
-# Add AppSettings section
-$sm.GetApplicationHostConfiguration().RootSectionGroup.Sections.Add("appSettings")
-
-# Set Allow for handlers section
-$appHostconfig = $sm.GetApplicationHostConfiguration()
-$section = $appHostconfig.GetSection("system.webServer/handlers")
-$section.OverrideMode="Allow"
-
-# Add aspNetCore section to system.webServer
-$sectionaspNetCore = $appHostConfig.RootSectionGroup.SectionGroups["system.webServer"].Sections.Add("aspNetCore")
-$sectionaspNetCore.OverrideModeDefault = "Allow"
-$sm.CommitChanges()
-
-# Configure globalModule
-Reset-IISServerManager -confirm:$false
-$globalModules = Get-IISConfigSection "system.webServer/globalModules" | Get-IISConfigCollection
-New-IISConfigCollectionElement $globalModules -ConfigAttribute @{"name"="AspNetCoreModule";"image"=$aspNetCoreHandlerFilePath}
-
-# Configure module
-$modules = Get-IISConfigSection "system.webServer/modules" | Get-IISConfigCollection
-New-IISConfigCollectionElement $modules -ConfigAttribute @{"name"="AspNetCoreModule"}
-```
+[!code-powershell[](nano-server/enable-aspnetcoremodule.ps1)]
> [!NOTE]
> Delete the files *aspnetcore.dll* and *aspnetcore_schema.xml* from the share after the above step.
diff --git a/aspnetcore/tutorials/nano-server/enable-ancm.ps1 b/aspnetcore/tutorials/nano-server/enable-aspnetcoremodule.ps1
similarity index 87%
rename from aspnetcore/tutorials/nano-server/enable-ancm.ps1
rename to aspnetcore/tutorials/nano-server/enable-aspnetcoremodule.ps1
index 6aaa07a8d1e0..3710e9886689 100644
--- a/aspnetcore/tutorials/nano-server/enable-ancm.ps1
+++ b/aspnetcore/tutorials/nano-server/enable-aspnetcoremodule.ps1
@@ -1,5 +1,5 @@
# Backup existing applicationHost.config
-copy C:\Windows\System32\inetsrv\config\applicationHost.config C:\Windows\System32\inetsrv\config\applicationHost_BeforeInstallingANCM.config
+copy C:\Windows\System32\inetsrv\config\applicationHost.config C:\Windows\System32\inetsrv\config\applicationHost_BeforeInstallingAspNetCoreModule.config
Import-Module IISAdministration
@@ -29,7 +29,3 @@ New-IISConfigCollectionElement $globalModules -ConfigAttribute @{"name"="AspNetC
# Configure module
$modules = Get-IISConfigSection "system.webServer/modules" | Get-IISConfigCollection
New-IISConfigCollectionElement $modules -ConfigAttribute @{"name"="AspNetCoreModule"}
-
-# Backup existing applicationHost.config
-copy C:\Windows\System32\inetsrv\config\applicationHost.config C:\Windows\System32\inetsrv\config\applicationHost_AfterInstallingANCM.config
-