Doc kestrel config reload support (#23256)

pull/23263/head
Chris Ross 2021-09-09 21:37:35 -07:00 committed by GitHub
parent 56795b507d
commit b6ad0a704c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -62,9 +62,11 @@ webBuilder.ConfigureKestrel(serverOptions =>
## Configure(IConfiguration)
Creates a configuration loader for setting up Kestrel that takes an <xref:Microsoft.Extensions.Configuration.IConfiguration> as input. The configuration must be scoped to the configuration section for Kestrel.
Enables Kestrel to load endpoints from an <xref:Microsoft.Extensions.Configuration.IConfiguration>. The configuration must be scoped to the configuration section for Kestrel.
`CreateDefaultBuilder` calls `Configure(context.Configuration.GetSection("Kestrel"))` by default to load Kestrel configuration.
The `Configure(IConfiguration, bool)` overload can be used to enable reloading endpoints when the configuration source changes.
`IHostBuilder.ConfigureWebHostDefaults` calls `Configure(context.Configuration.GetSection("Kestrel"), reloadOnChange: true)` by default to load Kestrel configuration and enable reloading.
```json
{
@ -85,6 +87,13 @@ Creates a configuration loader for setting up Kestrel that takes an <xref:Micros
}
```
If reloading configuration is enabled and a change is signaled then the following steps are taken:
- The new configuraiton is compared to the old one, any endpoint without configuration changes are not modified.
- Removed or modified endpoints are given 5 seconds to complete processing requests and shut down.
- New or modified endpoints are started.
Clients connecting to a modified endpoint may be disconnected or refused while the endpoint is restarted.
## ConfigureHttpsDefaults(Action\<HttpsConnectionAdapterOptions>)
Specifies a configuration `Action` to run for each HTTPS endpoint. Calling `ConfigureHttpsDefaults` multiple times replaces prior `Action`s with the last `Action` specified.