# 无法访问网站

**URL:** https://meta.discourse.org/t/cant-reach-site/224774
**Category:** Support
**Created:** [2022年四月19日 17:58 UTC](https://meta.discourse.org/t/cant-reach-site/224774 "2022-04-19T17:58:51Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![TheEngineer](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@TheEngineer](https://meta.discourse.org/u/TheEngineer)
#### Post date: [2022年四月19日 17:58 UTC](https://meta.discourse.org/t/cant-reach-site/224774/1 "2022-04-19T17:58:51Z")

</div>

我无法访问我的 discourse 站点。我当时正在将其迁移到一个新域名，但停止了操作并撤销了更改，它一直没有恢复。我按照[此主题](https://meta.discourse.org/t/change-the-domain-name-or-rename-my-discourse/16098?replies_to_post_number=115)更改了域名，然后按相反的顺序撤销了所有操作。

> [https://discourse.brandywinereef.com](https://discourse.brandywinereef.com)

在尝试运行 `./discourse-setup` 时，我收到：

> 正在检查您的域名 . . .  
> 警告：无法通过主机名 443 访问计算机的 443 端口。  
> 警告：连接到 [http://443](http://443)（端口 80）也失败。
> 
> 这表明 443 解析到一个未连接到您正在安装 discourse 的机器的 IP 地址。

使用 `ufw status` 检查返回：

> 状态：活动
> 
> 到达 操作 来自
> 
> * * *
> 
> 22/tcp 限制 任何地方  
> 80/tcp 允许 任何地方  
> 443/tcp 允许 任何地方  
> 22/tcp (v6) 限制 任何地方 (v6)  
> 80/tcp (v6) 允许 任何地方 (v6)  
> 443/tcp (v6) 允许 任何地方 (v6)

我手动清除了 Let’s Encrypt 证书并重新请求了。仍然没有反应。

有什么想法吗？

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2022年四月19日 18:02 UTC](https://meta.discourse.org/t/cant-reach-site/224774/2 "2022-04-19T18:02:18Z")

</div>

您的 app.yml 中的主机名配置不正确，它显示为空。

---

<div class="post-metadata">

### Author: ![TheEngineer](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@TheEngineer](https://meta.discourse.org/u/TheEngineer)
#### Post date: [2022年四月19日 18:13 UTC](https://meta.discourse.org/t/cant-reach-site/224774/3 "2022-04-19T18:13:57Z")

</div>

这是 app.yml 的顶部。看起来主机名就在那里……？

```plaintext
templates:
    - templates/postgres.template.yml
    - templates/redis.template.yml
    - templates/web.template.yml
    - templates/web.ratelimited.template.yml
    - templates/web.ssl.template.yml
    - templates/web.letsencrypt.ssl.template.yml
expose:
    - '80:80'
    - '443:443'
params:
    db_default_text_search_config: pg_catalog.english
    db_shared_buffers: 128MB
    version: tests-passed
env:
    LANG: en_US.UTF-8
    UNICORN_WORKERS: 2
    DISCOURSE_HOSTNAME: discourse.brandywinereereef.club

```

我猜那个文件夹里还有其他几个版本是备份，还有一个 import.yml。

---

<div class="post-metadata">

### Author: ![awlogan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awlogan/32/62208_2.png) [@awlogan](https://meta.discourse.org/u/awlogan)
#### Post date: [2022年四月19日 18:31 UTC](https://meta.discourse.org/t/cant-reach-site/224774/4 "2022-04-19T18:31:12Z")

</div>

您的主机名中有一个多余的“ree”：discourse.brandywineree **ree** f.club

---

<div class="post-metadata">

### Author: ![TheEngineer](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@TheEngineer](https://meta.discourse.org/u/TheEngineer)
#### Post date: [2022年四月19日 18:40 UTC](https://meta.discourse.org/t/cant-reach-site/224774/5 "2022-04-19T18:40:49Z")

</div>

哦，该死……抓得好！我会修复它并重新构建。

---

<div class="post-metadata">

### Author: ![TheEngineer](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@TheEngineer](https://meta.discourse.org/u/TheEngineer)
#### Post date: [2022年四月19日 19:10 UTC](https://meta.discourse.org/t/cant-reach-site/224774/6 "2022-04-19T19:10:02Z")

</div>

就是这样。解决了！

感谢 @awlogan

---

<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: [2022年五月19日 19:10 UTC](https://meta.discourse.org/t/cant-reach-site/224774/7 "2022-05-19T19:10:10Z")

</div>

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