ASP.NETCore2.0ngrok502错误网关错误
我一直在使用ASP.NET 4.X的ngrok而没有遇到任何问题.
不幸的是,当我尝试在ASP.NET Core 2中转发app build时,我遇到了一个我无法解决的问题.
我尝试了以下命令组合来启动ngrok:
ngrok http 44374-host-header =”localhost:44374″
ngrok http -host-header =重写localhost:44374
ngrok http 44374
所有都给出了相同的结果.Ngrok隧道启动,但是当我尝试打开给定的转发URL时,站点加载几分钟,然后显示502 Bad Gateway错误.它适用于http和https版本.
以管理员身份运行Visual Studio或ngrok无济于事.
网站与localhost正常工作
使用ngrok运行网站会出现502 Bad Gateway错误
1> Deleroy..:
我解决了我的问题.
properties/launchSettings.json内容:
{ “iisSettings”: { “windowsAuthentication”: false, “anonymousAuthentication”: true, “iisExpress”: { “applicationUrl”: “http://localhost:59889/”, “sslPort”: 44374 } }, “profiles”: { “IIS Express”: { “commandName”: “IISExpress”, “launchBrowser”: true, “launchUrl”: “https://localhost:44374/”, “environmentVariables”: { “ASPNETCORE_ENVIRONMENT”: “Development” } }, “NgrokTEST”: { “commandName”: “Project”, “launchBrowser”: true, “environmentVariables”: { “ASPNETCORE_ENVIRONMENT”: “Development” }, “applicationUrl”: “http://localhost:59890/” } }}
因此,事实证明ASP.NET Core使用不同的端口进行SLL连接,默认情况下使用它.
在ngrok中将端口更改为正常(在我的情况下为59890)解决了这个问题.