首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使NodeJS应用程序在Azure中公开可用

使NodeJS应用程序在Azure中公开可用
EN

Stack Overflow用户
提问于 2016-04-25 21:42:43
回答 2查看 106关注 0票数 0

我正在构建一个天蓝色模板(https://github.com/kevinday/azure-quickstart-templates/blob/master/augur-on-ubuntu/azuredeploy.json),它将在Ubuntu中运行一个nodejs应用程序。

代码语言:javascript
复制
npm start

augur-ui@2.0.0 start /root/augur
http-server ./build -c-1 -p $PORT

Starting up http-server, serving ./build
Available on:
http://127.0.0.1:true
http://10.0.0.4:true
Hit CTRL-C to stop the server

我想将http流量公开给我配置的dns名称,http://dnsname.eastus.cloudapp.azure.com

我已经看到了一些文档,这些文档建议在门户中配置和终结点,尽管我不再看到这个选项。有人能为我指出正确的方向吗?如何修改我的模板以便正确配置这个端点?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-04-26 05:08:19

您需要在网络安全组中创建入站规则,以允许端口80上的通信量。

代码语言:javascript
复制
{
  "apiVersion": "[variables('apiVersion')]",
  "type": "Microsoft.Network/networkSecurityGroups",
  "name": "[variables('networkSecurityGroupName')]",
  "location": "[resourceGroup().location]",
  "properties": {
    "securityRules": [
      {
        "name": "httpRule",
        "properties": {
          "description": "httpRule",
          "protocol": "Tcp",
          "sourcePortRange": "*",
          "destinationPortRange": "80",
          "sourceAddressPrefix": "*",
          "destinationAddressPrefix": "*",
          "access": "Allow",
          "priority": 110,
          "direction": "Inbound"
        }
      }
    ]
  }
}

有NSG和入站规则的完整模板示例如下:https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-security-group-create/azuredeploy.json

有关Azure网络安全组的更多信息,请参见:https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-nsg/

票数 0
EN

Stack Overflow用户

发布于 2016-04-28 08:40:18

正如我所知道的,您可以尝试创建NSG的web-rule -前端,以允许FrontEnd子网的HTTP流量。

请查看文档如何使用模板创建NSG,以了解如何使用ARM进行操作。

这里是一个示例ARM模板片段。

代码语言:javascript
复制
"apiVersion": "2015-06-15",
"type": "Microsoft.Network/networkSecurityGroups",
"name": "[parameters('frontEndNSGName')]",
"location": "[resourceGroup().location]",
"tags": {
  "displayName": "NSG - Front End"
},
"properties": {
  "securityRules": [
    {
        "name": "web-rule",
        "properties": {
        "description": "Allow WEB",
        "protocol": "Tcp",
        "sourcePortRange": "*",
        "destinationPortRange": "80",
        "sourceAddressPrefix": "Internet",
        "destinationAddressPrefix": "*",
        "access": "Allow",
        "priority": 101,
        "direction": "Inbound"
      }
    }
  ]
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36851607

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档