AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Setting ASPNETCORE_HTTPS_PORT does not work

Open janpalas2 opened this issue 8 years ago • 2 comments

When I set ASPNETCORE_HTTPS_PORT environment variable to (eg.) 44310, the HTTPS redirection does not work. However, when I set HTTPS_PORT environment variable, the HTTPS redirection does work.

This is also stated in HttpsRedirectionOptions.HttpsPort documentation. Quoting:

/// <remarks> /// If the HttpsPort is not set, we will try to get the HttpsPort from the following: /// 1. HTTPS_PORT environment variable /// 2. IServerAddressesFeature /// 3. 443 (or not set) /// </remarks>

I may be good idea to correct the environment variable name also on this page.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

janpalas2 avatar Jul 17 '18 08:07 janpalas2

@janpalas Are you using AddEnvironmentVariables explicitly (e.g., using the Generic Host or a WebHostBuilder), or are you relying upon CreateDefaultBuilder to add the env var config provider (e.g., using the WebHost)? If you are using AddEnvironmentVariables, are you specifying the prefix ASPNETCORE_?

guardrex avatar Jul 17 '18 12:07 guardrex

@janpalas I'm adding your issue to the planned configuration work on #7102. Hopefully, we'll be able to solve the env var prefix problem everywhere once and for all.

guardrex avatar Jul 17 '18 15:07 guardrex