【问题标题】:Hosting site on different containers on same docker host在同一 docker 主机上的不同容器上托管站点
【发布时间】:2021-11-05 12:05:18
【问题描述】:

我正在尝试设置多个容器来监听不同的端口托管站点。

例子:

example1.com 8080 -> 80 container1 (apache)
example2.com 8081 -> 80 container2 (apache)

正确的做法是什么?

我已经尝试过 http 重定向/重写(在容器内),但无法让它工作..

【问题讨论】:

    标签: linux docker apache


    【解决方案1】:

    您需要在服务器上安装反向代理。我会选择nginx 并将其配置为similar to here 以将流量转发到example1.com 到它自己的端口8080。在 Apache 中也可以这样做。它叫virtual hosts

    【讨论】:

      猜你喜欢
      • 2019-02-15
      • 2015-11-18
      • 2015-04-10
      • 1970-01-01
      • 2015-11-11
      • 1970-01-01
      • 2020-08-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多