CDN not working for websites located in subdirectory.

0

Hi,

I'm running a multisite with the following structure

/var/www/example.com/ -> Original Website
/var/www/example.com/en/ ->  Multilanguage website.

And when I apply CloudFront's CDN to the original site, it works perfectly.

However, CloudFront doesn't work for the /en website, which is located in a subdirectory.

I created a new distribution, set it up the same as the original website, and added /en to origin path additionally.

Is there something I'm missing? I'd love to get some advice.

Thank you.

  • Where is Cloudfront pointing to? EC2? S3? Could you provide screenshot of the Distribution?

  • You'll need to provide some additional information to help determine the root cause of the problem. What exactly do you mean by "it doesn't work?" Is there an error message or code? What do you see in your web server access logs?

質問済み 1年前310ビュー
1回答
1

CloudFront supports the root of the origin that your distribution is directed towards, but it doesn't work for subdirectories.

If you want the CloudFront distribution to reach the subdirectory, then you can use Lambda@Edge (Extra charge).

Here is a blog with more information: https://aws.amazon.com/blogs/compute/implementing-default-directory-indexes-in-amazon-s3-backed-amazon-cloudfront-origins-using-lambdaedge/

AWS
vtjean
回答済み 1年前

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

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

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

関連するコンテンツ