AWS cloudfront 403 error

Amazon看上去很美,不过眼睁睁看着每天几百美金的流量话费真是很心疼,于是计划把 AWS S3 上的资源转到AWS cloudfront,希望能在成本上有所减少。
不过在Amazon上配置了cloudfront的时候也是遇到了一些小问题,使用自有域名访问资源时返回403,提示 “ERROR the request could not be satisfied.”

aws-cloudfront-error

 

 

 

 

 

 

google了一下,发现是DNS解析的问题,之前的自有域名是CNAME到了S3上,如果遇到这样的问题需要再次把自有域名CNAME到cloudfront上,

如:

res.sudops.com CNAME res.sudops.com.s3.amazonaws.com.

需要改为

res.sudops.com CNAME d12345xxxxxxx.cloudfront.net.

这就与普通CDN做CNAME解析比较相似,不用配置回源地址。

生效后的http请求如下:

(Status-Line)	HTTP/1.1 200 OK
Content-Type	application/octet-stream
Content-Length	18848194
Connection	keep-alive
Date	Mon, 09 Jun 2014 08:56:00 GMT
Last-Modified	Thu, 22 May 2014 07:15:31 GMT
Etag	"c28e490aab1395dd8a4fdf24bf5702e7"
Accept-Ranges	bytes
Server	AmazonS3
X-Cache	Miss from cloudfront
Via	1.1 2c6248542582010bc022ce33969f1508.cloudfront.net (CloudFront)
X-Amz-Cf-Id	hwTvCyb90_E1kH-Qz1X3W4Vqq9xfVZkIPftZW4pDywvYJaPfemwKcA==

能够看出来cloudfront已经生效了,只是第一次请求会miss掉
X-Cache Miss from cloudfront

u2

Related Posts

rancher v2.x 初体验

rancher v2x

sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached

Python3 + Flask + mysql5.7搭建的w…

One thought on “AWS cloudfront 403 error

评论已关闭。

You Missed

雇佣AI员工,花钱上班:开发者的新”职场”荒诞剧

  • u2
  • 3月 1, 2026
  • 30 views
雇佣AI员工,花钱上班:开发者的新”职场”荒诞剧

OpenClaw 完整使用指南:自托管 AI Agent 的架构与实战

  • u2
  • 2月 25, 2026
  • 128 views
OpenClaw 完整使用指南:自托管 AI Agent 的架构与实战

Anthropic 推出 Claude Code Security:AI 驱动的代码安全神器

  • u2
  • 2月 24, 2026
  • 77 views

来自 OWASP 的代码安全检查工具:Dependency-Check,为你消除安全隐患

  • u2
  • 10月 16, 2025
  • 48 views
来自 OWASP 的代码安全检查工具:Dependency-Check,为你消除安全隐患

技术宅如何躲开越来越垃圾的CSDN?

  • u2
  • 4月 11, 2024
  • 35 views
技术宅如何躲开越来越垃圾的CSDN?

mysql连接失败:The driver has not received any packets from the server

  • u2
  • 3月 26, 2024
  • 36 views
mysql连接失败:The driver has not received any packets from the server