Can a CloudFront origin be another CloudFront distribution?


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: -> ->


asked 2 years ago2248 views
2 Answers

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.

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
answered 2 years ago

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.

answered 3 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