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

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容