【问题标题】:Running multiple apps in a server hiding ports在隐藏端口的服务器中运行多个应用程序
【发布时间】:2020-06-19 05:28:05
【问题描述】:

我正在开发两个不同的聊天机器人,并将它们放在 Google 平台虚拟机上。我想知道如何像这样访问它们:

->https://example.com/chatbot1

->https://example.com/chatbot2

而不是:

->https://example.com:5001

->https://example.com:5002

我想这样做,这样我就可以在同一个虚拟机上运行多个聊天机器人,而且我不会暴露端口。完成此操作后,想法是将聊天机器人插入到第三个用户网络上,如下所示:

<script>
  WebChat.default.init({
    selector: "#webchat",
    initPayload: "XXX",
    interval: 1000,
    customData: {"userId": "123"},
    socketUrl: "http://example.com/chatbot1",
    socketPath: "/socket.io/",
    title: "XXX",
    subtitle: "XXX",
    inputTextFieldHint: "XXX",
    connectingText: "XXX",
    hideWhenNotConnected: true,
    fullScreenMode: false,
    showFullScreenButton: false,
    profileAvatar: "xxx.jpg",
    params: {
      images: {
        dims: {
          width: 250,
          height: 200,
        }
      },
      storage: "XXX",
    },
  })
</script>

两者都需要通过 HTTPS 运行。我需要 Apache 或类似的东西吗?如果是这种情况,我该如何配置它?我不知道这是否相关,但我只能通过 SSH 访问虚拟机。

【问题讨论】:

    标签: apache redirect https port rasa


    【解决方案1】:

    听起来您可能想使用 Apache 的 name-based virtual hosts(参见 Running different sites on different ports 下的示例)。

    【讨论】:

      猜你喜欢
      • 2014-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多