简体   繁体   English

我可以使用IP地址浏览到Azure VM上的ASP.NET应用程序吗?

[英]Can I browse to my ASP.NET application on an Azure VM using an IP address?

I have a web site on a cloud server within my domain, which hosts a website with a url like http://myserver . 我在域内的云服务器上有一个网站,该网站托管一个网址为http://myserver I cannot access ASP.NET by IP address but I can by the server name. 我无法通过IP地址访问ASP.NET,但可以通过服务器名称访问。

I can get the ip address of the server 我可以获取服务器的IP地址
C:\\Users\\me>ping myserver C:\\ Users \\ me> ping myserver

Pinging myserver.mydomain.com [123.7.141.2] with 32 bytes of data: 使用32个字节的数据ping myserver.mydomain.com [123.7.141.2]:
Reply from 123.7.141.2: bytes=32 time=55ms TTL=121 来自123.7.141.2的回复:字节= 32时间= 55ms TTL = 121
Reply from 123.7.141.2: bytes=32 time=30ms TTL=121 来自123.7.141.2的回复:字节= 32时间= 30毫秒TTL = 121
Reply from 123.7.141.2: bytes=32 time=37ms TTL=121 来自123.7.141.2的回复:字节= 32时间= 37毫秒TTL = 121
Reply from 123.7.141.2: bytes=32 time=29ms TTL=121 来自123.7.141.2的回复:字节= 32时间= 29ms TTL = 121

Ping statistics for 123.7.141.2: 123.7.141.2的Ping统计信息:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), 数据包:已发送= 4,已接收= 4,丢失= 0(丢失0%),
Approximate round trip times in milli-seconds: 大约往返时间(以毫秒为单位):
Minimum = 29ms, Maximum = 55ms, Average = 37ms 最小值= 29ms,最大值= 55ms,平均值= 37ms

My expectation is that https://123.7.141.2 would allow me to browse successfully to the site as https://myserver does work. 我的期望是https://123.7.141.2将允许我像https://myserver一样正常地浏览到该站点。

The existing bindings in IIS 7 were IIS 7中的现有绑定是
type hostname port ip address 输入主机名端口IP地址
http myserver 80 * http myserver 80 *
http myserver 443 * http myserver 443 *

I added the following bindings 我添加了以下绑定

http myserver 80 123.7.141.2 http myserver 80 123.7.141.2
http myserver 443 123.7.141.2 http myserver 443 123.7.141.2

When I run ipconfig on myserver I get the following information 当在myserver上运行ipconfig时,我得到以下信息
C:\\Windows\\system32>ipconfig C:\\ Windows \\ system32> ipconfig
Windows IP Configuration Windows IP配置

Ethernet adapter Local Area Connection 4: 以太网适配器本地连接4:

Connection-specific DNS Suffix . 特定于连接的DNS后缀。 : myservername.d1.internal.cloudapp.net :myservername.d1.internal.cloudapp.net
Link-local IPv6 Address . 链接本地IPv6地址。 . . . . : ffff::ffff:ffff:ffff:ffff :ffff :: ffff:ffff:ffff:ffff
IPv4 Address. IPv4地址。 . . . . . . . . . . : 123.7.141.2 :123.7.141.2
Subnet Mask . 子网掩码 。 . . . . . . . . . . : 255.255.255.224 :255.255.255.224
Default Gateway . 默认网关 。 . . . . . . . . : 123.7.141.1 :123.7.141.1

Tunnel adapter isatap.myservername.d1.internal.cloudapp.net: 隧道适配器isatap.myservername.d1.internal.cloudapp.net:

Media State . 媒体状态。 . . . . . . . . . . : Media disconnected :媒体断开
Connection-specific DNS Suffix . 特定于连接的DNS后缀。 : myservername.d1.internal.cloudapp.net :myservername.d1.internal.cloudapp.net

Your bindings force IIS to wait for request with hostname=myserver. 您的绑定会强制IIS等待主机名= myserver的请求。 Try creating bindings like: 尝试创建绑定,例如:

type hostname port ip
http    *      80  *

This will allow IIS to serve your site even for requests without hostname and just IP. 这将使IIS可以为您的站点提供服务,即使没有主机名而只是IP的请求也是如此。

Make sure that you have opened port 80 for external access to your VM in the Azure Management Console. 确保已打开端口80,以便在Azure管理控制台中从外部访问VM。 Check the endpoints section on your VM page. 检查您的VM页面上的终结点部分。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我不能浏览我的ASP.NET网站? - Why can I not browse my ASP.NET website? Azure Linux VM + ASP.NET应用程序 - Azure Linux VM + ASP.NET application 我可以通过我的 ASP.NET 应用程序以编程方式将 IP 地址添加到 IIS7 中的动态 IP 限制扩展吗? - Can I programmatically add an IP address to Dynamic IP Restrictions extension in IIS7 from my ASP.NET app? 使用asp.net中的Web应用程序从我的PC浏览文件 - Browse a file from my pc using web application in asp.net 为什么我不能使用发布到Azure服务器的asp.net核心应用程序下载Azure Blob - Why can't I download an Azure Blob using an asp.net core application published to Azure server 为什么我的电话的 IP 地址报告不同(取决于站点),我如何以编程方式在 ASP.Net 中获得一致的地址? - Why is my phone's IP address reported differently (depending on the site) and how can I programmatically obtain a consistent one in ASP.Net? 可以使用IP地址浏览,但不能使用URL浏览 - Can browse using IP address but cannot browse using URL 在asp.net页面上找到系统的IP地址 - Finding the IP Address of my system on asp.net page 在 ASP.NET MVC 中无法获取访问我网站的客户端的 DHCP 分配 IP 地址 - In ASP.NET MVC can not get the DHCP assigned IP address of clients Which visits my website 将asp.net应用发布到RDP服务器时,如何为我的IP地址分配主机名? - How do I assign a hostname to my ip address when publishing asp.net app to RDP server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM