# 警告：计算机的 443 端口似乎无法通过主机名访问

**URL:** <https://meta.discourse.org/t/warning-port-443-of-computer-does-not-appear-to-be-accessible-using-hostname/173520>\
**Category:** Self-hosting\
**Created:** [2020 年12 月 16 日 18:53 UTC](https://meta.discourse.org/t/warning-port-443-of-computer-does-not-appear-to-be-accessible-using-hostname/173520 "2020-12-16T18:53:01Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

作者： ![lucasbasquerotto](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lucasbasquerotto/32/133376_2.png) [@lucasbasquerotto](https://meta.discourse.org/u/lucasbasquerotto)\
发布日期： [2020 年12 月 24 日 14:14 UTC](https://meta.discourse.org/t/warning-port-443-of-computer-does-not-appear-to-be-accessible-using-hostname/173520/17 "2020-12-24T14:14:25Z")

</div>

建议您在面向互联网的服务器上部署一个反向代理，并根据主机名将请求重定向到 WordPress 或 Discourse。

例如，在主机上运行一个使用 80 和 443 端口的 Nginx 服务，并将其配置为将 `blog.yourdomain` 的请求代理到 WordPress 服务（可以是主机上的内部端口，如果是 Apache + WordPress 架构，可以重定向到 Apache 端口，例如 8080，或者使用 FastCGI）。

然后在同一台服务器上运行 Discourse，确保将 `app.yml` 中的端口替换为主机上未使用的端口（如 8081），或者如 @neounix 所述使用 Unix 套接字。接着，将 `forum.yourdomain` 的请求代理到该端口或套接字。要运行 Discourse，需要在 Discourse 目录（通常是 `/var/discourse`）中执行 `./launcher rebuild app`。

在这种情况下，您不需要运行 `discourse-setup` 来创建 2GB 的交换文件（主要用于可能需要更多内存的升级，如果您的服务器内存充足，可能并不需要）以及生成 `app.yml` 文件。相反，您应该自行完成这些配置。如果您不确定 `app.yml` 文件中应填写的内容，我建议在另一台服务器上先运行推荐的安装流程，即使只是为了更熟悉 Discourse 并查看生成的 `app.yml` 文件，然后将其用于您的共享服务器（记得更改端口，如果使用套接字方式则移除端口配置）。

如果您无法继续操作，建议参考相关的 #howto 主题帖子。

---

_[View the full topic](https://meta.discourse.org/t/warning-port-443-of-computer-does-not-appear-to-be-accessible-using-hostname/173520)._
