简体   繁体   中英

CloudFront Path Pattern

I want to trigger a Lambda function from CloudFront when a Viewer Request event occurs, for the following cases:

  • any URL of directory or subdirectory
  • any *.html or *.htm file inside one of this subdirectory

I am trying to figure out the best way to create behaviours. So far, I have 2 behaviours

  • */ for root / any subdirectorys
  • .html for htm and html files

I don't know if there is a way to have only one Path for both cases.

You have to use.html for html and htm files. Because in URL directory serve like

https://www.example.com/about/

actually it serve

https://www.example.com/about/index.html

It will trigger if you do it for.html

After trying several options, I came to the conclusion that using two different behaviours is the only working option.

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