在连接到 Elastic Beanstalk 的 Amazon VPC 上使用 HTTPS
Using HTTPS on a Amazon VPC connected to Elastic Beanstalk
好的,所以我在弹性 beantalk 上有一个工作的 Flask 应用程序,我需要在上面安装 HTTPS 运行。我将它连接到具有弹性 IP 的 VPC,因此我的 DNS 可以路由到它。
我已成功将我的 HTTPS 证书上传到 IAM,并使用弹性 beantalk 面板中的配置部分将其添加到我的应用程序的负载均衡器,但问题是我不知道如何将它应用到 VPC。
这是我当前的设置,以便您了解我遇到困难的原因
domain on namecheap
|
|
Name server records are pointing to digital ocean
|
|
DNS A records on digital ocean ---> Various subdomains hosted on digital ocean
|
|
Subdomain pointing to elastic IP on VPC (want to add HTTPS here)
|
|
elastic IP pointing to elastic beanstalk env
|
|
load balancer which has cert (connecting directly here gives the cert)
|
| (this connection is HTTP)
|
app
我真的不需要端到端加密,我觉得证书应该以某种方式附加到 VPC 而不是负载均衡器。不过我不知道该怎么做。
我尝试过的事情
- 直接连接到给定的自动生成的 env 域有效,但证书是针对我的子域的,所以我收到安全错误
- 在 VPC 的安全组部分,我检查了端口 443 是否对负载均衡器和 VPC 安全组的入站和出站流量开放
问题是域名指向弹性IP。这不是使用 Elastic Beanstalk 的正确方法,并且根本不适用于负载均衡器。 DNS 记录应该是指向 Elastic Load Balancer 域名的 CNAME。如果您需要它是像 "example.com" 这样的根域而不是像 "www.example.dom" 这样的子域,那么您必须将 DNS 从 Digital Ocean 转移到 AWS Route53
好的,所以我在弹性 beantalk 上有一个工作的 Flask 应用程序,我需要在上面安装 HTTPS 运行。我将它连接到具有弹性 IP 的 VPC,因此我的 DNS 可以路由到它。
我已成功将我的 HTTPS 证书上传到 IAM,并使用弹性 beantalk 面板中的配置部分将其添加到我的应用程序的负载均衡器,但问题是我不知道如何将它应用到 VPC。
这是我当前的设置,以便您了解我遇到困难的原因
domain on namecheap
|
|
Name server records are pointing to digital ocean
|
|
DNS A records on digital ocean ---> Various subdomains hosted on digital ocean
|
|
Subdomain pointing to elastic IP on VPC (want to add HTTPS here)
|
|
elastic IP pointing to elastic beanstalk env
|
|
load balancer which has cert (connecting directly here gives the cert)
|
| (this connection is HTTP)
|
app
我真的不需要端到端加密,我觉得证书应该以某种方式附加到 VPC 而不是负载均衡器。不过我不知道该怎么做。
我尝试过的事情
- 直接连接到给定的自动生成的 env 域有效,但证书是针对我的子域的,所以我收到安全错误
- 在 VPC 的安全组部分,我检查了端口 443 是否对负载均衡器和 VPC 安全组的入站和出站流量开放
问题是域名指向弹性IP。这不是使用 Elastic Beanstalk 的正确方法,并且根本不适用于负载均衡器。 DNS 记录应该是指向 Elastic Load Balancer 域名的 CNAME。如果您需要它是像 "example.com" 这样的根域而不是像 "www.example.dom" 这样的子域,那么您必须将 DNS 从 Digital Ocean 转移到 AWS Route53