Can a CloudFront origin be another CloudFront distribution?

0

Are there any issues with chaining CloudFront distributions like this?

Use case: An application that has 2 origins — an S3 bucket and an API. The API will be used by other projects so it has its own CloudFront and we want its cache to be available to those projects.

Example:

project1.example.com -> api.example.com

project2.example.com -> api.example.com

Thanks!

2回答
0

If you just want to call the API with multiple names, there is no need for second distribution but you could add alternative names to your "api" distribution. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html

I'm not sure how good idea is to have 2 levels of caching but you could configure "api" distribution as custom origin for "project" distributions. I recall there might be some loop-detection in Cloudfront not allowing this, but should be able to work-a-round by limiting origin request headers you forward from "project" distribution to "api" distribution.

profile picture
エキスパート
Kallu
回答済み 2年前
0

Yes you can chain CloudFront distributions, but only 2-deep. It's not optimal however customers have various use-cases to do this.

If you try 3-deep it will fail.

AWS
回答済み 2ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ