简体   繁体   中英

Cloudfront Path pattern issue

I have a AWS S3 bucket with directory structure with each user in my application having a seperate director like Dir(User-ID) eg Dir(1233233) . I want to create 2 cloudfront path patter such that -

  1. The images(png and jpg) just inside the parent directory should be accessible without a signed url (should be public).
  2. All other sub-directories and files should require a signed url (should be private).

I am trying to create something like Dir(*)/*.jpg with unsigned policy and a default one with a signed policy. This doesn't seem to work. Any ideas on how can I achieve this?

'(' is not an acceptable character and will not work with patterns.

Checked on,

Dir*/*.jpg

and it works.

Based on the documentation,

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesPathPattern

The maximum length of a path pattern is 255 characters. The value can contain any of the following characters:

AZ, az

Path patterns are case sensitive, so the path pattern *.jpg doesn't apply to the file LOGO.JPG.

0-9

_ - . * $ / ~ " ' @ : +

&, passed and returned as & amp;

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM