Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws cloudfront path pattern for multiple file types

I would like to create a single behavior for more than one file extension type (e.g. *.html and *.php). Is there any way to do this with a single behavior? Separating the two paths with a | or a , isn't accepted.

Thanks for your help

like image 409
Rick Battagline Avatar asked May 10 '18 18:05

Rick Battagline


People also ask

Can AWS CloudFront have multiple origins?

You can configure a single CloudFront web distribution to serve different types of requests from multiple origins.

What is path pattern in CloudFront?

Path pattern. A path pattern (for example, images/*. jpg ) specifies which requests you want this cache behavior to apply to. When CloudFront receives an end-user request, the requested path is compared with path patterns in the order in which cache behaviors are listed in the distribution.

Can I store files in CloudFront?

To use Amazon CloudFront, you: For static files, store the definitive versions of your files in one or more origin servers. These could be Amazon S3 buckets. For your dynamically generated content that is personalized or customized, you can use Amazon EC2 – or any other web server – as the origin server.

What is CloudFront precedence?

Precedence. As there can be more than one cache behavior that matches a given path ( /api/image. jpg is matched by both /api/* and *. jpg ), CloudFront needs to break this tie. Because of this, there is an ordering between the behaviors.


1 Answers

There is not a way to do this with CloudFront.

Each cache behavior only accepts one simple globbing pattern, with ? matching exactly 1 character, and * matching 0 or more characters. It isn't a regular expression match.

like image 115
Michael - sqlbot Avatar answered Sep 28 '22 03:09

Michael - sqlbot