# 安装后出现SSL错误

**URL:** https://meta.discourse.org/t/error-ssl-after-installation/162327
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [2020年八月28日 07:35 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327 "2020-08-28T07:35:08Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![cmdntd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmdntd/32/192008_2.png) [@cmdntd](https://meta.discourse.org/u/cmdntd)
#### Post date: [2020年八月28日 07:35 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/1 "2020-08-28T07:35:08Z")

</div>

我在安装 Discourse 后遇到了这个错误。  
我通过 Docker、Google Cloud 和 Plesk 安装，并映射到 3000 端口。

浏览器端：

在子域名上：

# 502 Bad Gateway

nginx

在带 3000 端口的 IP 上：  
ERR\_CONNECTION\_REFUSED

应用根目录（SSH）：  
nginx: [emerg] 无法加载证书 “/shared/ssl/wiki.cmdgroups.com.cer”: PEM\_read\_bio\_X509\_AUX() 失败 (SSL: error:0909006C:PEM routines:get\_name:no start line:Expecting: TRUSTED CERTIFICATE)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [2020年八月28日 11:39 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/2 "2020-08-28T11:39:02Z")

</div>

> [@cmdntd](#):
>
> 将 plesk 端口映射到 3000

这听起来你并没有遵循[官方安装说明](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)。

---

<div class="post-metadata">

### Author: ![cmdntd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmdntd/32/192008_2.png) [@cmdntd](https://meta.discourse.org/u/cmdntd)
#### Post date: [2020年八月28日 12:30 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/3 "2020-08-28T12:30:43Z")

</div>

我已经完成了，但我将端口改为了3000。因为我有很多端口被其他服务占用，所以在将 Discourse 映射到子域名之前，我先将其改到了3000端口。

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2020年八月28日 13:30 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/4 "2020-08-28T13:30:14Z")

</div>

Discourse 必须安装在标准端口上。您目前的操作方式不受支持。

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [2020年八月29日 04:21 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/5 "2020-08-29T04:21:14Z")

</div>

> [@cmdntd](#):
>
> 我完成了，但我改用了 3000 端口。  
> 因为我有很多端口被其他服务占用，所以在映射到子域名之前，我将 Discourse 改到了 3000 端口。

查看这篇 Meta 安装帖子以获取更多线索：

> [@Install Discourse on Plesk(Ubuntu 18.04 LTS)](https://meta.discourse.org/t/install-discourse-on-plesk-ubuntu-18-04-lts/138196):
>
> Hello Guys, i have followed the Install Tutorial for Plesk Onyx (Ubuntu 14.04), but i had many problems. Now i have everything working on my Plesk and i decided to make a new Tutorial(Mail with the Plesk Mail Server) 1. Set options in Plesk Create Domain/Subdomain in Plesk. Activate Let’s Encrypt Certificate. Create a mail account. my example: mail@domain.tld password123 2. Install Docker Go to Extensions. Search for Do…

---

<div class="post-metadata">

### Author: ![cmdntd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmdntd/32/192008_2.png) [@cmdntd](https://meta.discourse.org/u/cmdntd)
#### Post date: [2020年八月29日 05:25 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/6 "2020-08-29T05:25:51Z")

</div>

> [@在 Plesk (Ubuntu 18.04 LTS) 上安装 Discourse，帖子：1，主题：138196](#):
>
> /etc/hosts

是的，这正是我需要的  
非常感谢

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [2020年八月29日 06:32 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/7 "2020-08-29T06:32:33Z")

</div>

> [@cmdntd](#):
>
> 是的，这正是我需要的  
> 非常感谢

不客气 @cmdntd

很高兴能帮你享受这个周末。

* * *

_不要试图去 **弯曲勺子** ，那是不可能的。相反，只需去领悟真相…… **根本没有勺子** 。然后你就会明白， **弯曲的** 不是 **勺子** ，而是 **你自己** 。_ ——《黑客帝国》（1999）

---

<div class="post-metadata">

### Author: ![cmdntd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmdntd/32/192008_2.png) [@cmdntd](https://meta.discourse.org/u/cmdntd)
#### Post date: [2020年八月29日 08:23 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/8 "2020-08-29T08:23:17Z")

</div>

> [@在 Plesk (Ubuntu 18.04 LTS) 上安装 Discourse，第 1 楼，主题：138196](#):
>
> /etc/hosts

您好，安装现在已经成功了。  
但它的网址只是 http。看起来 Let’s Encrypt 已经完成了，但 https 无法正常工作。

当我刷新时，一开始是 https，但最终会重定向到 http。  
这就像有 SSL，但显示“不安全”？

 ![Desktop-screenshot](https://global.discourse-cdn.com/meta/original/3X/9/9/99f64567773a3f0d446340731867b365c4b98135.png)

您有什么建议吗？

---

<div class="post-metadata">

### Author: ![JimPas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimpas/32/148179_2.png) [@JimPas](https://meta.discourse.org/u/JimPas)
#### Post date: [2020年八月29日 09:03 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/9 "2020-08-29T09:03:20Z")

</div>

您的图标和图像均使用 http 协议，因此存在混合内容问题。您需要将 http 更改为 https。

---

<div class="post-metadata">

### Author: ![cmdntd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmdntd/32/192008_2.png) [@cmdntd](https://meta.discourse.org/u/cmdntd)
#### Post date: [2020年八月29日 09:16 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/10 "2020-08-29T09:16:04Z")

</div>

我该如何配置 HTTPS？  
我已经启用了 Let’s Encrypt，但遇到了这个问题

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [2020年八月29日 09:42 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/11 "2020-08-29T09:42:40Z")

</div>

嘿，@cmdntd，加油！

试试这个设置：

 ![Screen Shot 2020-08-29 at 4.42.04 PM](https://global.discourse-cdn.com/meta/original/3X/0/f/0f3f4047996d7a117dc7cd05ff5e0bbc6b22ec61.jpeg)

---

<div class="post-metadata">

### Author: ![cmdntd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmdntd/32/192008_2.png) [@cmdntd](https://meta.discourse.org/u/cmdntd)
#### Post date: [2020年八月29日 10:01 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/12 "2020-08-29T10:01:03Z")

</div>

哇，前面看起来没问题  
但在登录用户界面我看到显示“不安全”。不过，用户的图片现在正常了。

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [2020年八月29日 10:34 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/13 "2020-08-29T10:34:04Z")

</div>

嘿 @cmdntd

你可能需要考虑重新构建你的应用，并确保正确安装了 Let’s Encrypt。

说实话，我从未使用过 Plesk，一直直接在 Ubuntu 或 macOS 等操作系统上工作，所以我不是帮你解决 Plesk 问题的最佳人选。

看来你正在取得进展；保持信心，你很快就能把所有问题都解决（正常运行）的。

---

<div class="post-metadata">

### Author: ![cmdntd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmdntd/32/192008_2.png) [@cmdntd](https://meta.discourse.org/u/cmdntd)
#### Post date: [2020年八月30日 02:51 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/14 "2020-08-30T02:51:14Z")

</div>

我不确定我的DNS是否尚未完成。  
今天，我登录后看到HTTPS一切正常。

---

<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年九月29日 02:51 UTC](https://meta.discourse.org/t/error-ssl-after-installation/162327/15 "2020-09-29T02:51:30Z")

</div>

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