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?

질문됨 일 년 전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
답변함 일 년 전

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

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

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

관련 콘텐츠