这是我自己的版本。我差点放弃,但 @tophee 链接到我(!?)写的一篇帖子,提供了必要的“魔法”!现在,配置 Nginx Proxy Manager 以支持 Discourse 变得非常简单。我认为这使其与 Run other websites on the same machine as Discourse - #396 类似。
按照其说明安装 Nginx Proxy Manager
移除 SSL 和 Let’s Encrypt 模板:
确保您的 yml 文件中的以下行已被注释掉或删除:
## 如果您想添加 Lets Encrypt (https),请取消注释这两行
#- "templates/web.ssl.template.yml"
#- "templates/web.letsencrypt.ssl.template.yml"
让 Discourse 使用 npm-default 网络。
如果您盲目遵循 Nginx Proxy Manager 的安装说明,它将创建一个名为 npm_default 的 Docker 网络。
将以下段落添加到您的 yml 文件(或多个文件)中。如果您有独立的 web_only 和 data 容器,则需要将此项添加到每个容器中(我未测试 mail-receiver 容器)。docker_args 不需要缩进。
docker_args: |
--network npm_default
无需暴露任何端口
从您的 yml 文件中注释掉或删除以下行:
# expose:
# - "80:80" # http
# - "443:443" # https
然后您可以重新构建您的容器,并按如下方式配置 Nginx Proxy Manager:

启动第二个 Discourse 站点的一种简单(但不一定推荐)的方法如下:
cd /var/discourse/containers
cp app.yml othersite.yml
# 以某种方式编辑 othersite.yml 中的主机名(至少)
./launcher rebuild othersite
然后像上面一样将其添加到 NPM,但使用 othersite 代替 app。
我在一个 app.yml 加上两个 web_only 类型容器和一个单独的 data 容器以及一个单独的 othersite-redis 容器上测试了此方法,该容器是仅包含 redis 模板的 data 容器的副本。(但更简单的解决方案是将额外的 redis 放入 web_only 容器中)。