简体   繁体   English

如何配置弹性beantalk以将https和ACM证书一起使用?

[英]How do I configure elastic beanstalk to use https with an ACM certificate?

I used the AWS certificate manager to create an ACM certificate. 我使用AWS证书管理器来创建ACM证书。

I followed this guide: https://medium.com/@arcdigital/enabling-ssl-via-aws-certificate-manager-on-elastic-beanstalk-b953571ef4f8#.kjh1mqdzq to configure the load balancer using the aws cli. 我遵循了该指南: https ://medium.com/@arcdigital/enabling-ssl-via-aws-certificate-manager-on-elastic-beanstalk-b953571ef4f8#.kjh1mqdzq使用aws cli配置负载均衡器。

When I look at my load balancers, I now see 443(HTTPS, ACM Certification:[arn]) forwarding to 80 (HTTP) under Port Configuration 当我查看负载均衡器时,现在在端口配置下看到443(HTTPS,ACM认证:[arn])转发到80(HTTP)

However, if I type in https in my browser I get the "your connection is not private" message from chrome. 但是,如果我在浏览器中输入https,则会从chrome收到“您的连接不是私有”消息。

Is there another step that I'm missing? 我还缺少其他步骤吗?

You haven't given this info, but I'm assuming you have a CNAME for www.yourdomain.com that is resolving to loadbalancer.amazonaws.com. 您尚未提供此信息,但是我假设您有一个用于解析www.yourdomain.com的CNAME,该域名正在解析为loadbalancer.amazonaws.com。

You are getting the ERR_INSECURE_RESPONSE error because you are using a CNAME which is resolving to loadbalancer.amazonaws.com. 由于使用的CNAME正在解析到loadbalancer.amazonaws.com,因此出现ERR_INSECURE_RESPONSE错误。 Since your certificate is for www.yourdomain.com, it is giving a valid error. 由于您的证书适用于www.yourdomain.com,因此给出了有效的错误。 CNAME and Alias operate slightly differently. CNAME和Alias的操作略有不同。 With a CNAME the traffic is not a valid alias of your domain so if you're trying to secure it, you will receive errors. 使用CNAME时,流量不是您域的有效别名,因此,如果您尝试保护它的安全,则会收到错误消息。 However, when you create an A record for www and alias that to loadbalancer.amazonaws.com now any traffic from loadbalancer.amazonaws.com on www.yourdomain.com is valid traffic for your domain and you will no longer have those errors. 但是,当您为www创建A记录并为loadbalancer.amazonaws.com创建别名时,现在www.yourdomain.com上来自loadbalancer.amazonaws.com的任何流量对于您的域都是有效的流量,并且您将不再出现这些错误。

In order to terminate secure traffic for www.yourdomain.com at loadbalancer.amazonaws.com you need to have an A record that will alias there. 为了在loadbalancer.amazonaws.com终止www.yourdomain.com的安全流量,您需要有一个在此处别名的A记录。 Unfortunately, ELB's only provide a DNS entry, no IP address, but many DNS providers (ie GoDaddy) will not allow you to have a DNS A record that is aliased to a DNS address; 不幸的是,ELB只提供一个DNS条目,没有IP地址,但是许多DNS提供商(例如GoDaddy)都不允许您使用别名为DNS地址的DNS A记录。 they require you to alias to an IP address. 它们要求您将别名别名为IP地址。 Which makes life a bit more complex. 这使生活变得更加复杂。

There are a couple ways to accomplish this (URL forwarding and masking is not supported by SSL), but the easiest solution is to use Route 53. Use of Route 53 doesn't require you to register or transfer your name to AWS and a hosted zone is just $0.50/month per domain. 有两种方法可以完成此操作(SSL不支持URL转发和屏蔽),但是最简单的解决方案是使用Route53。使用Route 53不需要您将名称注册或转让给AWS和托管区域每个域每月只需$ 0.50。

To use Route 53 follow these steps: 要使用Route 53,请按照下列步骤操作:

  • Create a Hosted Zone for yourdomain.com. 为yourdomain.com创建托管区域。 When you create a Hosted Zone in Route 53 it will complete a few default records (like an A, NS, and SOA records). 当您在Route 53中创建托管区域时,它将完成一些默认记录(例如A,NS和SOA记录)。 Note the NS records as you'll need them later. 注意NS记录,因为以后需要它们。
  • Next copy your existing zone file entries (like MX records) from your current DNS provider to your new hosted zone. 接下来,将您现有的区域文件条目(例如MX记录)从当前的DNS提供程序复制到新的托管区域。
  • When it comes to a record that you want to direct traffic for to your ELB you'll enter the name, say www, and then just below the type option field you'll see a radio option that says "Alias: yes no". 当涉及到要将流量定向到您的ELB的记录时,您将输入名称,例如www,然后在类型选项字段下方,您会看到一个单选选项,显示“别名:是,否”。 - - When you select yes, the value field will disappear and you'll see an option that says "Alias Target: Enter Target Name". --当您选择“是”时,值字段将消失,并且您会看到一个选项:“别名目标:输入目标名称”。 When you click that field you'll receive a drop down list of resources in your account that you can alias to. 当您单击该字段时,您会在帐户中收到一个可以用作别名的资源下拉列表。 Simply select your load balancer. 只需选择您的负载均衡器即可。
  • Click create, and you're done with Route 53. Now that all your dns records are copied over, and you'll go to your registrar and change the nameservers to the ones that Route 53 provided you. 单击“创建”,就完成了Route53。现在,所有的dns记录都被复制了,您将转到注册商处,并将名称服务器更改为Route 53为您提供的名称服务器。

Now Route 53 is handling your DNS for you. 现在,Route 53正在为您处理DNS。 And loadbalancer.amazonaws.com is a valid alias of www.mydomain.com. 并且loadbalancer.amazonaws.com是www.mydomain.com的有效别名。 Since loadbalancer.amazonaws.com is now a valid alias of www.yourdomain.com when you visit www.yourdomain.com your ELB at loadbalancer.amazonaws.com will terminate the traffic as www.yourdomain.com and your error will be resolved. 由于loadbalancer.amazonaws.com现在是www.yourdomain.com的有效别名,因此当您访问www.yourdomain.com时,位于loadbalancer.amazonaws.com的ELB将以www.yourdomain.com终止流量,您的错误将得到解决。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Classic Load Balancer 配置 Elastic Beanstalk NodeJS 应用程序以使用 HTTPS? - How do I configure an Elastic Beanstalk NodeJS application with a Classic Load Balancer to use HTTPS? 带有 Elastic Beanstalk 的 AWS 证书管理器(ACM 证书) - AWS Certificate Manager (ACM Certificate) with Elastic Beanstalk 通过ACM和负载均衡器为AWS Nodejs弹性beantalk设置HTTPS,如何在s3存储桶中为angular设置HTTPS - HTTPS is set up for aws Nodejs elastic beanstalk throught ACM and load balancer, how do i set up the HTTPS for angular in s3 bucket 在ACM中为Elastic Beanstalk后端申请证书 - Request a certificate in ACM for Elastic Beanstalk backend 将AWS Certificate Manager(ACM证书)与Elastic Beanstalk配合使用 - Using AWS Certificate Manager (ACM Certificate) with Elastic Beanstalk 如何为我的 Elastic Beanstalk Java 应用程序启用 HTTPS? - How do I enable HTTPS for my Elastic Beanstalk Java application? 如何在AWS Elastic Beanstalk环境中配置负载均衡器? - How do I configure a load balancer in an AWS Elastic Beanstalk environment? 如何配置Amazon AWS Elastic Beanstalk服务? - How do I configure Amazon AWS Elastic Beanstalk services? 如何使用 https 在弹性 beantalk 中配置单个 ec2 实例 - How to configure single ec2 instance in elastic beanstalk with https 如何将 AWS 凭证与 Jenkins 结合使用以部署到 Elastic Beanstalk? - How do I use AWS credentials with Jenkins to deploy to Elastic Beanstalk?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM