如何在 Node.js 项目上通过 Azure VM 中的 IP 连接容器?

How to connect container by IP in Azure VM on Node.js project?

任务: 将项目部署到 Azure VM 云。

步骤:

问题: 该网站在 div 中显示 grafana。在我的本地将 grafana 的地址定义为 localhost:3001 但是当我在 VM 上启动项目并尝试从我的本地 pc 加载站点时,grafana 的 div 没有加载。

更多信息:

网站尝试连接我电脑上的本地主机,我需要写入 AzureVM 的 Grafana 容器 IP 地址,但我不知道该怎么做。

你可以试试把听力URL改成https://0.0.0.0:3001localhost始终用于访问虚拟机内部的应用程序,无法在虚拟机外部访问。