【问题标题】:Node js deployement in Azure server could not be accesses outside using ip无法使用 ip 访问 Azure 服务器中的节点 js 部署
【发布时间】:2022-01-21 19:15:31
【问题描述】:

我尝试使用 CLI 在 azure ubuntu 中部署一个简单的节点 js 服务,控制台日志显示服务器在端口 8080 上运行(该服务在我的本地计算机上运行良好),但是当我尝试从外部访问公共 ip ,它给出了网站无法访问

以下是我部署服务时的输出

azureuser@myVM:~/drugdemo/user_service/drulistService$ vi server.js
azureuser@myVM:~/drugdemo/user_service/drulistService$ node server.js
App is listening on 8080
^C^C
azureuser@myVM:~/drugdemo/user_service/drulistService$ pm2 start server.js
[PM2] Starting 
/home/azureuser/drugdemo/user_service/drulistService/server.js in fork_mode (1 instance)
[PM2] Done.


 Use `pm2 show <id|name>` to get more details about an app
 azureuser@myVM:~/drugdemo/user_service/drulistService$

请帮助我提出您的建议。 (我已经尝试将 'localhost' 更改为 '0.0.0.0' 和 '127.0.0.1' 但对我不起作用)

提前谢谢你

【问题讨论】:

    标签: node.js azure logging azure-deployment


    【解决方案1】:

    确保也通过 Azure 打开防火墙端口,而不仅仅是服务器。

    这可能会有所帮助:https://blogs.msdn.microsoft.com/pkirchner/2016/02/02/allow-incoming-web-traffic-to-web-server-in-azure-vm/

    【讨论】:

      猜你喜欢
      • 2016-11-17
      • 1970-01-01
      • 2020-09-16
      • 1970-01-01
      • 1970-01-01
      • 2017-06-01
      • 2018-06-11
      • 2016-11-19
      • 2014-03-01
      相关资源
      最近更新 更多