日志中出现了健康检查对应的警告
2023-02-24 16:59:01.025 [Warning] Failed to determine the https port for redirect.
/alive
Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware
Program 中对应的代码
app.UseForwardedHeaders();
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
app.MapControllers();
app.MapHealthChecks("/alive");
在 appsettings.json
中添加 https_port
设置解决了
{
"https_port": 443
}
对应的开源代码 HttpsRedirectionMiddleware.cs
– dudu 1年前