【问题标题】:https timeouts on AWS elastic beanstalk appAWS弹性beantalk应用程序上的https超时
【发布时间】:2018-10-18 19:12:18
【问题描述】:

我们的一个 Elastic Beanstalk 应用程序遇到了一个奇怪的问题,每个 https 连接都会导致超时。通过openssl s_client 验证证书本身没有问题,所以它看起来像是负载平衡器的问题 - 但那里的一切都很好,所以我有点难过。

我们没有使用 Route 53(通过 namecheap 管理 DNS)并且我们的证书是从外部购买的(不使用 AWS 证书管理器)。

我的主要问题是:

  • 我无权访问我们的 Namecheap 帐户,但我确信那里一切正常 - 通过将负载均衡器/aws 配置作为罪魁祸首,我是否走在正确的轨道上,或者确实这听起来可能是一些奇怪的 DNS 错误配置?

  • 在不通过路由 53 管理 DNS 时,是否有充分的理由避免使用 AWS 证书管理器?如果使用 AWS 提供的证书可以解决这个问题,我很乐意改用这条路线。 This 问题非常相似,但处理的是 AWS 提供的证书。

【问题讨论】:

  • 听起来您的安全组之一配置不正确。我经常看到的另一个问题是将负载均衡器指向实例的端口 443。您仍然应该将其指向端口 80 并让它使用 HTTP。

标签: amazon-web-services ssl https dns amazon-elastic-beanstalk


【解决方案1】:

也许您将负载均衡器指向端口 443 + HTTPS 而不是 80 + HTTP?尝试按照图片所示设置 Classic Load Balancer。

示例 1

示例 2

【讨论】:

  • 非常适合我。
  • 我们也应该启用 443 吗?与在 docker 容器上打开 443 端口相比,这是否存在安全隐患?
【解决方案2】:
There are two places to enable https on elastic beanstalk:
Place 1: From elastic beanstalk environment
select Services
select Elastic Beanstalk
select the environment within the application
select Configuration
in Load balancer section: select modify 
select Add listener
  listener port: 443
  listener protocol: HTTPS
  Instance port: 80
  Instance protocol: HTTP
  SSL certificate: Add an ACM certificate created from AWS or another

Place 2: The load balancer
select Services
select EC2
scroll down left panel: select Load balancers
select Action
select Edit Listeners
select Add
  listener port: 443
  listener protocol: HTTPS
  Instance port: 80
  Instance protocol: HTTP
  SSL certificate: Add an ACM certificate created from AWS or another
select Save

【讨论】:

    【解决方案3】:

    弹性豆茎上有两个地方可以开启https:

    地点 1:来自弹性豆茎环境

    • 选择服务

    • 选择 Elastic Beanstalk

    • 在应用程序中选择环境

    • 选择配置

    • 在负载均衡器部分:选择修改

    • 使用以下信息选择“添加侦听器”:

      listener port: 443
      listener protocol: HTTPS
      Instance port: 80
      Instance protocol: HTTP
      SSL certificate: Add an ACM certificate created from AWS or another  
      

    地点 2:负载均衡器

    • 选择服务

    • 选择 EC2

    • 向下滚动左侧面板:选择负载均衡器

    • 选择操作

    • 选择编辑监听器

    • 使用以下信息选择“添加侦听器”:

      listener port: 443
      listener protocol: HTTPS
      Instance port: 80
      Instance protocol: HTTP
      SSL certificate: Add an ACM certificate created from AWS or another
      
    • 选择保存

    【讨论】:

      猜你喜欢
      • 2013-07-09
      • 2016-04-23
      • 2014-11-29
      • 2017-05-25
      • 2020-11-25
      • 2018-03-26
      • 2019-06-18
      • 2015-12-30
      • 2019-06-07
      相关资源
      最近更新 更多