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

Read more

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

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

Read more

One thought on “AWS cloudfront 403 error

评论已关闭。

You Missed

MCP Gateway 完全指南:企业级 AI Agent 的控制平面

  • u2
  • 5月 17, 2026
  • 31 views

技术深度解析:Model Context Protocol (MCP)

  • u2
  • 5月 16, 2026
  • 39 views

Hermes Agent 自动学习与成长原理深度解读

  • u2
  • 5月 14, 2026
  • 72 views

Agent Memory + Skills 双轮驱动 Memori Labs × Anthropic Dreaming 执行记忆 vs 会话记忆,如何构建持续进化的 Agent

  • u2
  • 5月 11, 2026
  • 84 views
Agent Memory + Skills 双轮驱动 Memori Labs × Anthropic Dreaming 执行记忆 vs 会话记忆,如何构建持续进化的 Agent

基于大模型的测试用例生成解决方案

  • u2
  • 5月 10, 2026
  • 93 views

从0到1搭建一个AI Token中转站:技术架构与实战指南

  • u2
  • 5月 2, 2026
  • 713 views