简体   繁体   English

如何使用SSL连接到AWS“应用程序负载平衡器”

[英]how do I connect to an AWS “Application Load Balancer” with SSL

I have just set up my first "Application Load Balancer" and I chose the SSL option to connect allowing AWS to generate the certificate for me based on my domain (www.example.com). 我刚刚设置了第一个“应用程序负载平衡器”,并且选择了SSL选项进行连接,从而使AWS可以根据我的域(www.example.com)为我生成证书。

I have set the target to my EC2 instance and now I want to connect to the Load Balancer but not sure how. 我已将目标设置为我的EC2实例,现在我想连接到负载均衡器,但不确定如何。 If I just connect to the DNS name of the load balancer I get an invalid certificate error. 如果仅连接到负载均衡器的DNS名称,则会收到无效的证书错误。

I have read that I need to set a record for my domain but because the IP of an application load balancer may change, not sure if that is a good idea. 我已经读到我需要为我的域设置一个记录,但是由于应用程序负载平衡器的IP可能会更改,因此不确定这是否是一个好主意。

The documentation mentions the following: 该文档提到以下内容:

Clients can use the Server Name Identification (SNI) protocol extension to specify the hostname they are trying to reach. 客户端可以使用服务器名称标识(SNI)协议扩展来指定他们尝试访问的主机名。

But I couldn't figure out how to do that. 但是我不知道该怎么做。 I'm very new to Load Balancers and not quite sure how to proceed. 我对负载均衡器很陌生,不太确定如何进行。

The following problem is easy to solve with AWS Route 53 : 使用AWS Route 53可以轻松解决以下问题:

  • Create a hosted zone in Route 53 在Route 53中创建托管区域
  • Choose the name of the hosted zone that has the domain name that you want to use to route traffic to your load balancer 选择具有您要用来将流量路由到负载均衡器的域名的托管区域的名称
  • Choose Create Record Set . 选择创建记录集
  • Specify the following values: 指定以下值:

    Name : 名称

    Type the domain name that you want to use to route traffic to your ELB load balancer. 键入要用于将流量路由到ELB负载平衡器的域名。 The default value is the name of the hosted zone. 默认值为托管区域的名称。

    For example, if the name of the hosted zone is example.com and you want to use acme.example.com to route traffic to your load balancer, type acme. 例如,如果托管区域的名称是example.com,并且您想使用acme.example.com将流量路由到负载均衡器,请键入acme。

    Type : 类型

    Choose A – IPv4 address. 选择一个– IPv4地址。

    Alias : 别名

    Choose Yes. 选择是。

    Alias Target 别名目标

    Find the applicable category in the list (ELB Application Load Balancers, ELB Classic Load Balancers, or ELB Network Load Balancers) , and then choose the name that you assigned to the load balancer when you created it. 在列表中找到适用的类别(ELB应用程序负载平衡器,ELB经典负载平衡器或ELB网络负载平衡器) ,然后选择在创建负载平衡器时分配给它的名称。

    Routing Policy : Accept the default value of Simple . 路由策略 :接受默认值Simple

    Evaluate Target Health : 评估目标健康状况

    If you want Route 53 to route traffic based on the health of your resources, choose Yes 如果希望Route 53根据资源的健康状况路由流量,请选择“ 是”。

  • Choose Create . 选择创建

Also If you don't want to use Route 53 and if it's not at the apex, you use a CNAME to the ELB. 另外,如果您不想使用Route 53并且不在顶点处,则可以对ELB使用CNAME

Refer to this Guide 请参阅本指南

Something like : 就像是 :

my.web.thingy.org        CNAME  my-loadbalancer-1234567890.us-west-2.elb.amazonaws.com.

And yes you are correct the IP of ELB Changes Frequently and thus it is not recommended to use A Record in DNS. 是的,您是正确的,经常更改ELB的IP,因此不建议在DNS中使用A记录。

Hope this Helps 希望这可以帮助

暂无
暂无

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

相关问题 我是否必须在 AWS Application Load Balancer 后面的 nginx.conf 文件中配置 SSL 证书文件? - Do I have to configure SSL certificates files in nginx.conf file behind AWS Application Load Balancer? AWS Application Load Balancer SSL终止 - aws application load balancer ssl termination 如何将 Route 53 子域连接到 EC2 负载均衡器? (SSL 不匹配问题) - How do I connect Route 53 subdomain to EC2 load balancer? (SSL mismatch issue) 如何将域名连接到 AWS Application Load Balancer? - how to connect domain name to AWS Application Load Balancer? 设置适用于Angular + NodeJS Web应用程序的AWS Application Load Balancer时如何解决错误 - How do I fix the Error when setup AWS Application Load Balancer For Angular+NodeJS Web Application 如何在us-east-1之外将HTTPS API网关和应用程序负载均衡器结合使用? - How do I combine AWS API Gateway and Application Load Balancer for HTTPS outside of us-east-1? 如何从 Application Load Balancer 中删除 AWS WAF Classic? - How do I remove AWS WAF Classic from Application Load Balancer? 如何配置 AWS 应用程序负载均衡器和 NAT 网关以拥有公共 IP - How do I configure AWS Application load balancer and NAT gateway to have the public IP AWS Application Load Balancer SSL 终止与 Apache Docker - AWS Application Load Balancer SSL Termination with Apache Docker AWS EC2应用程序负载均衡器+双向SSL? - AWS EC2 Application Load Balancer + Two-Way SSL?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM