我的 ec2 amazon linux 2 容器上的 https 连接失败

https connection fails on my ec2 amazon linux 2 for a container

我这两天一直在努力解决我的问题。我有一个 ec2 实例 (AMI),它托管了一个在 http (http connection to my server). I have followed this tutorial for setting up the https (SSL/TLS) connection: set-up let's encrypt on my ec2 instance on my ec2 instance via let's encrypt (free SSL certificate). It seems to work because when I connect to http://conv.carbonfreeconf.com/ then it goes to https://conv.carbonfreeconf.com/ automatically (which is the desired behavior). However, when I try to connect to the container via the 7000 port in https (https://conv.carbonfreeconf.com:7000) 中运行良好的 docker 容器,它说:ERR_SSL_PROTOCOL_ERROR 但它通过 http.

运行

你知道为什么它可以通过正常 URL 工作,但一旦我连接到特定端口就不行吗?

非常感谢任何帮助...

因为我看到这也与 Convergence 有关,所以我会跳到这里(这里的维护者之一)。问题是 Apache httpd 是一个独立的 Web 服务器。您已将其设置为在端口 80 上为 http 服务,在 443 端口上为 https 服务。 Apache 服务器不知道端口 7000 上的 docker 容器 运行。默认情况下,apache httpd 服务器仅从其 www 目录提供 HTML 文件。 docker container 运行 Convergence 是一个完全独立于 apache 的进程。它们 运行 在不同的端口上,默认情况下不通信。简单地安装 apache 并让它监听端口 80 和 443 无助于将 HTTPS 应用于端口 7000 上的 Convergence 运行。

我看到您正在使用 apache 让 Let's Encrypt 为 HTTPS 证书工作。我假设您想要的是那些 HTTP 证书也适用于 Convergence。如果是这样,您需要将 Apache 设置为反向代理。您可能希望为此使用 mod_proxy。查看以下 link.

https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html

本质上,apache 将接受端口 443 上的传入流量,然后将流量(内部到 linux 主机)转发到端口 7000 以进行收敛。根据您的设置方式,apache 正在提供的当前 Web 内容可以保留并仍然存在,或者被 docker 容器服务器所取代(或通过使用基于路径的路由将两者结合起来) ).