gpt4 book ai didi

asp.net - 在 Windows Server 上无法确定重定向的 https 端口,但在 PC 上无法确定?

转载 作者:行者123 更新时间:2023-12-05 08:11:22 25 4
gpt4 key购买 nike

我创建了一个 Asp.Net 应用程序并将其发布到服务器 (Windows Server 2012 R2)。它收到以下消息,错误为 Failed to determine the https port for redirect

PS C:\Users\xxx\Website> .\Blazor.exe
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Users\xxx\Websites\Portal1
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
Failed to determine the https port for redirect.

但是在我的电脑上运行就没有这个错误吗?

info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Users\xxx\Downloads\WebSite\WebHub

最佳答案

我认为您的问题出在您的 appsettings.json 文件上。不指定行:

"https_port": 443,

为了指示哪个端口是 SSL 端口,Blazor ASP.NET 不确定将流量路由到哪里。

关于asp.net - 在 Windows Server 上无法确定重定向的 https 端口,但在 PC 上无法确定?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59184248/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com