无法从Internet连接到.net核心应用 [英] Cannot connect to a .net core app from internet

查看:72
本文介绍了无法从Internet连接到.net核心应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在azure中创建了一个VM,并且正在侦听端口xxxx上运行的.Net Core自托管Web应用程序.此端口启用了入站流量虚拟机(使用入站端口规则添加),但是我无法从Internet访问该网站- 我的应用程序正在http://0.0.0.0:xxxx上侦听,我可以使用localhost:xxxx从VM访问该应用程序.可能是什么原因?我想念什么吗?

I have created a VM in azure and is running a .Net Core self hosted web app listening on port xxxx. This port is enabled for inbound traffic on  the VM  (added using inbound port rules), But I am not able to access the web site from internet - My app is listening on http://0.0.0.0:xxxx, I can access the app from the VM using localhost:xxxx. What could be the reason? Am I missing anything?

干杯

Jereesh

推荐答案

除了设置虚拟机的网络安全组以允许应用程序所需的端口外,相同将需要在虚拟机的操作系统防火墙上完成.这通常是导致无法远程控制的原因 访问虚拟机上托管的应用程序.

In addition to setting up your Virtual Machine's Network Security Group to allow the required port for your application, the same will need to be done on the Virtual Machine's operating system firewall. This can often be the cause of not being able to remotely access an application that's hosted on a Virtual Machine.

在为应用程序的端口创建Network Security Group规则时,请确保将源端口范围字段设置为Any.仅将目标端口范围字段设置为所需的端口.

When creating the Network Security Group rule for your application's port, please make sure that you set the source port range field to Any. Only the destination port range field will need to be set to the desired port.

为便于参考,我们提供了以下有关在网络安全组上打开端口的指南.

For your reference, we have the following guide on opening ports on a Network Security Group.

https://docs.microsoft.com/zh-CN /azure/virtual-machines/windows/nsg-quickstart-portal

如果此答案有帮助,请单击标记为答案"或向上投票.要提供有关您的论坛体验的其他反馈,请单击 此处

If this answer was helpful, click "Mark as Answer" or Up-Vote. To provide additional feedback on your forum experience, click Here


这篇关于无法从Internet连接到.net核心应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆