【问题标题】:Cloudflare 521 Error when using AWS API Gateway使用 AWS API Gateway 时出现 Cloudflare 521 错误
【发布时间】:2022-07-17 11:33:39
【问题描述】:

在 Lambda 函数前面部署 API Gateway 函数并使用 Cloudflare 设置后,我不断收到来自 Cloudflare 的 521 错误。

我已完成所有必要的步骤,例如生成证书、在 API Gateway 中创建自定义域等。

【问题讨论】:

    标签: amazon-web-services aws-api-gateway cloudflare


    【解决方案1】:

    事实证明,在 Cloudflare 中,SSL 设置必须设置为 FullFull (strict)。否则,您将收到来自 Cloudflare 的 521 错误。

    这是因为 AWS API Gateway 不允许 HTTP 连接并且需要 HTTPS 连接。在 Cloudflare 中将 HTTPS 设置为 OffFlexible 时,它将无法通过 HTTPS 连接,因此无法连接到 AWS。

    当然建议使用Full (strict) 以确保您网站的额外安全性。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-24
      • 2021-04-02
      • 2014-12-04
      • 2021-10-29
      • 1970-01-01
      • 2021-10-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多