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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南