- 域名配置完成
- 已创建 AWS EC2 实例
- 使用 ACM 颁发了证书
- 配置了 443 端口并通过 ALB 连接了证书
- ALB 将域名流量路由到 80 端口的 EC2 实例
在构建 Discourse 之前,我修改了 app.yml 文件以配置 HTTP 连接:
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
## Uncomment the next line to enable the IPv6 listener
#- "templates/web.ipv6.template.yml"
- "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#- "templates/web.ssl.template.yml"
#- "templates/web.letsencrypt.ssl.template.yml"
## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
- "80:80" # http
#- "443:443" # https
进行更改后,我构建了 Discourse 并检查了配置,但 nginx 仍然因以下错误而请求 SSL 密钥:
[emerg] 7416#7416: cannot load certificate "/shared/ssl/discourse.xxxxxxx.com.cer": PEM_read_bio_X509_AUX() failed (SSL: error:0480006C:PEM routines::no start line:Expecting: TRUSTED CERTIFICATE)
有什么方法可以阻止 nginx 尝试加载密钥,或者让 nginx 通过 HTTP 正常工作吗?