How can I connect multiple s3 static apps to one Cloudfront and direct traffic to the different s3 based on path

0

0

I have three static apps hosted in three separate S3 buckets, and I want to connect them to a single CloudFront distribution. My goal is to achieve the following URL structure:

org1.example.com: Default app org1.example.com/second: Second static app org1.example.com/third: Third static app

Constraints: I want to avoid using EC2 due to cost considerations, and each organization should access all three apps under one subdomain.

Attempts: I've tried using CloudFront behaviors to route based on subdirectories, but that didn't work. Additionally, I attempted to use Lambda@Edge with origin behavior, but it also failed to meet my requirements.

Question: How can I properly configure CloudFront to achieve the desired URL structure with multiple S3 buckets and one subdomain for different organizations?

1개 답변
0

Hello.

How are CloudFront's behaviors configured?
For example, if the path settings are as follows, wouldn't it be possible to access another S3?
In the case of the following path, the setting will be to access the S3 bucket when accessing "org1.example.com/second/yyy.html" etc.

org1.example.com/second/*

I think the following StackOverflow answer will be helpful.
https://stackoverflow.com/questions/31567994/multiple-cloudfront-origins-with-behavior-path-redirection

profile picture
전문가
답변함 5달 전
profile pictureAWS
전문가
검토됨 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인