简体   繁体   English

为Azure虚拟机创建HTTPS终结点

[英]Create HTTPS endpoint for Azure Virtual Machine

I have created a virtual machine in Azure and enabled the IIS role. 我已经在Azure中创建了一个虚拟机并启用了IIS角色。

I have created the appropriate firewall rules to allow me to browse to a website that I have set up in IIS over HTTP. 我创建了适当的防火墙规则,以允许我浏览通过IIS在IIS中设置的网站。

However, despite having created the bindings and firewall rules to enable HTTPS, I am unable to browse to the same website over HTTP. 但是,尽管创建了绑定和防火墙规则来启用HTTPS,但我无法通过HTTP浏览到相同的网站。

I have been reading that I need to create a HTTPS endpoint for Azure to traffic any requests on port 443 to my site. 我读到我需要为Azure创建一个HTTPS终结点,以将端口443上的任何请求传输到我的站点。

Does anyone know how to do this in the new portal? 有人知道如何在新门户中执行此操作吗?

Thanks, 谢谢,

Sean 肖恩

By default, when you create a VM, only port 3389 (RDP) is opened. 默认情况下,创建虚拟机时,仅打开端口3389(RDP)。 You will need to add any additional ports that you need to the Network Security Group. 您需要将所需的所有其他端口添加到Network Security Group。

Here is an example of how to add an NSG inbound rule to allow traffic on port 80 (HTTP), but you can use the same steps to allow traffic on port 443 (HTTPS): 这是有关如何添加NSG入站规则以允许端口80(HTTP)上的流量的示例,但是您可以使用相同的步骤来允许端口443(HTTPS)上的流量:

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

Ok, so I have got this working so I will document the steps that I went through in order to get this to work: 好的,所以我已经开始工作了,因此我将记录为使工作正常进行的步骤:

  1. Create a public IP address in the Azure portal 在Azure门户中创建公共IP地址
  2. Assign a 'cloudapp.azure.com' DNS name to the IP address 为IP地址分配一个“ cloudapp.azure.com” DNS名称
  3. Associate the IP address to an Azure network interface (this network interface may be attached to a VM or an App Service – in our case, it's a VM) 将IP地址与Azure网络接口相关联(此网络接口可能已附加到VM或应用程序服务–在我们的示例中是VM)
  4. Create an http endpoint in IIS and set the host name in your bindings to the 'cloudapp.azure.com' DNS name and the the IP address to the IP address created in step 1 在IIS中创建http终结点,并在绑定中将主机名设置为“ cloudapp.azure.com” DNS名称,并将IP地址设置为在步骤1中创建的IP地址
  5. Create a https endpoint and select your wildcard server certificate as the SSL certificate 创建一个https端点,然后选择您的通配符服务器证书作为SSL证书
  6. Create a 'CNAME Record' entry in your DNS Configuration where the host is your custom DNS name and the target is the Azure DNS name 在DNS配置中创建“ CNAME记录”条目,其中主机是您的自定义DNS名称,目标是Azure DNS名称
  7. Open a web browser and browse to your custom DNS name via https and ensure that the website displays the server certificate 打开Web浏览器,然后通过https浏览到您的自定义DNS名称,并确保该网站显示服务器证书。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM