# 如何配置外部 nginx 与 Discourse

**URL:** https://meta.discourse.org/t/how-can-i-configure-external-nginx-with-discourse/154201
**Category:** Self-hosting
**Created:** [2020年六月8日 15:39 UTC](https://meta.discourse.org/t/how-can-i-configure-external-nginx-with-discourse/154201 "2020-06-08T15:39:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rainmanjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rainmanjam/32/153506_2.png) [@rainmanjam](https://meta.discourse.org/u/rainmanjam)
#### Post date: [2020年六月8日 15:39 UTC](https://meta.discourse.org/t/how-can-i-configure-external-nginx-with-discourse/154201/1 "2020-06-08T15:39:44Z")

</div>

我正在按照以下说明在 Docker 之外设置 Discourse：

> **[Install Discourse Forum on Ubuntu 18.04 Without Docker](https://www.linuxbabe.com/ubuntu/install-discourse-ubuntu-18-04-server-without-docker)**
>
> This tutorial is going to show you how to install Discourse on Ubuntu 18.04 server without docker on a 1GB virtual private server (VPS).

我使用的是 Digital Ocean，并希望采用他们的实现方式。他们使用 CA 证书进行连接。我该如何在步骤 3 中修改 discourse.conf 以包含 CA 证书？

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2020年六月8日 16:01 UTC](https://meta.discourse.org/t/how-can-i-configure-external-nginx-with-discourse/154201/2 "2020-06-08T16:01:22Z")

</div>

那不是安装 Discourse 的官方方式。您应该直接向 Discourse 团队咨询以获取设置方面的帮助，或者使用 [官方安装指南](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md) 进行安装。

---

<div class="post-metadata">

### Author: ![rainmanjam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rainmanjam/32/153506_2.png) [@rainmanjam](https://meta.discourse.org/u/rainmanjam)
#### Post date: [2020年六月8日 16:05 UTC](https://meta.discourse.org/t/how-can-i-configure-external-nginx-with-discourse/154201/3 "2020-06-08T16:05:13Z")

</div>

谢谢。我没有找到在 Discourse 前面使用 nginx 的说明。

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2020年六月8日 16:07 UTC](https://meta.discourse.org/t/how-can-i-configure-external-nginx-with-discourse/154201/4 "2020-06-08T16:07:14Z")

</div>

您也可以在 Docker 中运行 Discourse 来实现这一功能。例如，请查看此主题：

> [@Add an offline page to display when Discourse is rebuilding or starting up](https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238?u=itsbhanusharma):
>
> warning This guide is intended for advanced users, who are already using nginx outside the docker container. By following this guide you make your setup more complicated and will lose some speed benefits like HTTP2 if you’re not running Ubuntu 16.04 or later. Proceed with caution! When Discourse is rebuilding or starting up, your users will usually either see an error message from their browser… …or a not-so-nice 502 error message from Nginx: If you’re a perfectionist …

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2020年七月8日 16:07 UTC](https://meta.discourse.org/t/how-can-i-configure-external-nginx-with-discourse/154201/5 "2020-07-08T16:07:37Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
