Route53 和 Cloudfront 请求无法满足?

Jon*_*Sud 11 amazon-web-services amazon-cloudfront amazon-route53

我只想在 cdn.mydomain.com 上提供我的 s3 文件

所以我创建了在https://dxxxxxxxx.cloudfront.net/test.jpg上运行良好的 cloudfront 发行版- 我得到了图像。

现在我想将我的域 atcdn.domain.com与 route53 中的 cloudfront相关联。

所以我创建了 A 记录类型 A-IPv4 地址。与名称cdn.domain.com别名目标我手动放置dxxxxxxxx.cloudfront.net

但是当我打开网址时:

http://cdn.mydomain.com/test.jpg

我收到错误:

403 ERROR
The request could not be satisfied.
Bad request. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
Generated by cloudfront (CloudFront)
Run Code Online (Sandbox Code Playgroud)

我的配置遗漏了什么?

Ton*_*yVo 15

我之前遇到过这个问题。CloudFront 阻止的请求。

请检查此列表:

  • 在 Cloudfront 备用域名中添加了 CDN 域。将 CDN 域添加到 Cloudfront 后,您无需键入即可选择 CloudFront 端点

  • WAF(如果有)不会阻止您的请求

  • 检查 Http 和 Https

  • 是的,正如你所说。我只需要用 ssl 填写“备用域名”:“cdn.mydomain.com”(没有 ssl - 不允许保存)。之后,我从列表中将 A 记录别名点设置为 cloudfront。这是有效的。谢谢! (8认同)
  • 由于错误中发现了自相矛盾,因此可以将这种特定情况与丢失/不正确的备用域名隔离 - 它显示“403”,还显示“错误请求”,但真正的错误请求响应是 HTTP 状态 400,不是 403。当 CloudFront 找不到具有与传入 HTTP“Host”标头匹配的备用域名的分配时,它会执行此操作。WAF 阻止为 403,但错误正文不会显示“错误请求”。 (4认同)

tju*_*kan 5

就我而言,错误是由发送带有请求正文的 GET 请求引起的,删除此请求解决了问题。