【发布时间】:2022-07-17 11:33:39
【问题描述】:
在 Lambda 函数前面部署 API Gateway 函数并使用 Cloudflare 设置后,我不断收到来自 Cloudflare 的 521 错误。
我已完成所有必要的步骤,例如生成证书、在 API Gateway 中创建自定义域等。
【问题讨论】:
标签: amazon-web-services aws-api-gateway cloudflare
在 Lambda 函数前面部署 API Gateway 函数并使用 Cloudflare 设置后,我不断收到来自 Cloudflare 的 521 错误。
我已完成所有必要的步骤,例如生成证书、在 API Gateway 中创建自定义域等。
【问题讨论】:
标签: amazon-web-services aws-api-gateway cloudflare
事实证明,在 Cloudflare 中,SSL 设置必须设置为 Full 或 Full (strict)。否则,您将收到来自 Cloudflare 的 521 错误。
这是因为 AWS API Gateway 不允许 HTTP 连接并且需要 HTTPS 连接。在 Cloudflare 中将 HTTPS 设置为 Off 或 Flexible 时,它将无法通过 HTTPS 连接,因此无法连接到 AWS。
当然建议使用Full (strict) 以确保您网站的额外安全性。
【讨论】: