[英]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.