如何获取从S3转发到Cloudfront的主机名? [英] How to fetch HOST NAME forwarded from S3 to cloudfront?

查看:97
本文介绍了如何获取从S3转发到Cloudfront的主机名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用AWS S3和Cloudfront服务设置CDN。我添加了替代性的CName来访问特定s3bucket的cloudfront。我想在我需要用于访问Cloudfront的CName处添加路由规则。



更多说明:



据我了解。 S3bucket是我们可以将内容称为对象的容器。使用第二个服务云前端可以在不同的边缘服务器上缓存s3bucket对象的内容。除了由Amazon为指向s3bucket的Cloudfront提供的domainURL之外,我们还可以添加其他CName。现在的问题是我想在s3存储桶中添加路由规则,但我需要使用所使用的备用Cname。我希望我已经解释了我的问题。如果有不清楚的地方,我很乐意将其清除。有人可以告诉我我该怎么做吗?

解决方案


现在的问题是我要添加s3存储桶中的路由规则,但我需要使用使用的备用Cname。


这是不可能的,原因有两个: / p>


  • S3不支持针对传入的 Host:标头实施路由规则。 S3认为对同一存储桶的所有请求都相同。


  • CloudFront不会以任何形式将原始主机标头转发给S3。




要完成所需的工作,您将需要多个CloudFront发行版和多个存储桶-每个唯一组一组路由规则。


I am setting up a CDN using AWS S3 and cloudfront services. I have added alernative CNames to access the cloudfront for specific s3bucket. I want to add a routing rule where i need the CName used to access the cloudfront.

More Explaination:

As per my understanding. The S3bucket is the container where we can put our content known as objects. Using the second serivce cloudfront is what caches this content of s3bucket object on different edge servers. We can also add alternative CNames apart from the domainURL provided by Amazon for the cloudfront which is pointing to s3bucket. Now the problem is i want to add the routing rule in s3 bucket but i need to use the alternative Cname used. I hope i have explained my problem. If there is something unclear i would be glad to clear it up. Anyone can tell me how can i do that?

解决方案

Now the problem is i want to add the routing rule in s3 bucket but i need to use the alternative Cname used.

That isn't possible, for two reasons:

  • S3 does not support implementing routing rules against the incoming Host: header. S3 considers all requests for the same bucket to be the same.

  • CloudFront does not forward the original host header to S3 in any form.

To accomplish what you want, you would need multiple CloudFront distributions and multiple buckets -- one set for each unique group of routing rules.

这篇关于如何获取从S3转发到Cloudfront的主机名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆