1

I'm using s3 with cloudfront. I have an application that has two index files.

/index /admin/index

The /index works fine the /admin/index requires me to put /admin/index.html without including index.html it throws

<Error>
  <Code>AccessDenied</Code>
  <Message>Access Denied</Message>
  <RequestId>D989FEFADF688159</RequestId>
  <HostId>
    GvoytrXvDOLPu26AiYYaq6Zi4ck42xyZy3mdxlSF8q5AZc4WEphayr5o6WVDxNM7+qutIAfn53k=
  </HostId>
</Error>

I checked the permissions on the file they are correctly set. Additionally I can view the file when using the full url /admin/index.html.

Is this expected behavior or something wrong with my configuration of s3 / cloudfront.

MrB
  • 1,544
  • 3
  • 18
  • 30
  • Looks like you can configure CloudFront to use S3 web endpoint rather than it's REST endpoint: https://stackoverflow.com/a/34065543/93345 . Not sure why it seems to default to the REST endpoint :p . – steamer25 Sep 01 '17 at 18:15

1 Answers1

1

I think cloudfront is the issue. It appears you can't have multiple index files when using cloud front. http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html

I ended up adding the index.html to the route to make it work.

MrB
  • 1,544
  • 3
  • 18
  • 30