多个子域来源的cloudfront路径模式示例 [英] cloudfront path pattern example for multiple subdomain origins

查看:179
本文介绍了多个子域来源的cloudfront路径模式示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,一个云端发行版具有与之关联的以下CNAME

For example, a cloudfront distribution has the following CNAMEs associated with it

photo-cdn.example.com
video-cdn.example.com
music-cdn.example.com

具有以下关联的来源

originA: photo.example.com/photocontents
originB: video.example.com/videocontents
originC: music.example.com/musiccontents

我想成为能够通过如下所示的Cloudfront分发获取以下内容文件:

I would like to be able to GET the following content files via the Cloudfront distribution as mapped below:

photo-cdn.example.com/photo.jpg => originA/photo.jpg
photo-cdn.example.com/image.png => originA/image.png

video-cdn.example.com/video.mpg => originB/video.mpg
video-cdn.example.com/movie.avi => originB/poster.jpg

music-cdn.example.com/music.mp3 => originC/music.mp3
music-cdn.example.com/itune.wav => originC/albumart.png

实现此行为所需的具体路径模式应该是什么?

What should be the specific path patterns that i need to use to achieve this behavior?

路径模式评估仅在分发域路径的SUFFIX上进行(在 music-cdn.example.com / )?

Will the path pattern evaluation happen only on the SUFFIX of the distribution domain path (after music-cdn.example.com/)?

或者路径模式评估是否将包含分发域路径(包括 music-cdn.example.com )。

Or will the path pattern evaluation INCLUDE the distribution domain path (include music-cdn.example.com).

推荐答案

只要您没有重叠的文件类型,就可以使用 / *之类的掩码。 jpg / *。png / *。mpg 等。

As long as you don't have overlapping file types you can use masks like /*.jpg, /*.png, /*.mpg etc.

但是它不起作用,例如如果需要从music-cdn域中获取.jpg专辑封面。

But it won't work e.g. if you need to fetch .jpg album art from your music-cdn domain.

在这种情况下,您可能需要将其分成3个不同的发行版,每个发行版都有一个CNAME

In this case you might need to split this into 3 different distributions, each having a single CNAME


编辑:请阅读以下评论,以进一步阐明哪些部分实际上是通过路径模式评估来评估CNAME的>

read the comments below for further clarification on which portions of the CNAME are actually evaluated by the path pattern evaluation

这篇关于多个子域来源的cloudfront路径模式示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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