cloudfront distribution with several origins

0

Hi, I have a CloudFront distribution that I want to links to 3 origins (buckets ) and be able to serve content from those buckets using 1 Alternate domain name. Is it possible? and how do I set it up?

asked 3 years ago606 views
2 Answers
1
Accepted Answer

Of course, it is possible.

You need to define 3 origins and then assign them to proper behaviours using regex to create path patterns.

It means for example

  • example.com/bucketA -> serve BucketA - pathPattern: /bucketA*
  • example.com/bucketB -> serve BucketB - pathPattern: /bucketB*
  • example.com -> serve BucketC - pathPattern: Default (*)
profile picture
answered 3 years ago
AWS
EXPERT
reviewed 5 months ago
  • I used the name of a folder in the root of each bucket in the path pattern and it worked. Thanks

0

Currently I am using a cloudfront distribution to serve my frontend. I am looking to use the same domain for backend too. For that I have added a behavior in cloudfront distribution. All the /api/* requests are mapped to go to an API gateway origin. However when I make the api call to /api/* path pattern, Im getting 404 Not found. The request is reaching cloudfront but not getting redirected to the api gateway.

I have verified for typos, origin path is empty and the api gateway url is functional. Am I missing something?

answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions