如何在 discourse/docker 中直接修改 Nginx 配置?

感谢您的帮助。

以下是对我有效的解决方案:

  1. 我禁用了 Let’s Encrypt 和 HTTPS:
#- templates/web.ssl.template.yml

#- templates/web.letsencrypt.ssl.template.yml
```\n
2. HAProxy 现在为 Discourse 处理 SSL 证书
3. 我在 `/var/discourse/containers/app.yml` 文件中使用了此配置

run:

  • replace:
    filename: /etc/nginx/conf.d/discourse.conf
    from: “types {”
    to: |
    set_real_ip_from 192.68.1.8; # HAProxy IP ADDRESS
    real_ip_header X-Forwarded-For;
    real_ip_recursive on;
    types {

现在我在 Discourse 管理界面中确实可以看到公共 IP 地址:

![Screenshot_20260705_184755_Chrome|686x321](upload://xt9PVScHKKFJ3FtoCXRsI1UU9AM.jpeg)

@Ethsim2

再次感谢您的帮助。:grin: