4

I've got an S3 bucket configured to host a static website, and if I browse to the bucket URL it shows the index.html file. I also have a CloudFront distribution to show another S3 bucket under a custom domain. Is there any chance I could configure CloudFront to serve one bucket from the root and another from a custom path? So:

  mydomain.com            -> bucket1/index.html
  mydomain.come/some-path -> bucket2/index.html

I already created an origin for the bucket and set up a path pattern for it and some-path, but I'm getting 403 Forbidden, even though if I browse to the origin directly I can see the webpage.

1 Answer 1

2

This configuration works fine, but it requires that the object in bucket2 be located at some-path/index.html inside bucket2.

The path pattern you configured in the cache behavior is still part of the request path, so it is forwarded to the origin.

CloudFront does not support removing part of the request path before forwarding the request to the origin.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.