You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a current limitation with this template where all paths must be referenced by the full file name, and not the directory name.
e.g a site with the path /foowhere /foo/index.html exists, does not serve the index.htmlfile and instead responds with the error file.
This is due to a limitation with Cloudfront, and the workaround is to use the bucket's web facing url, and point Cloudfront at the web origin instead of as an S3 origin. See this stackoverflow question.
Amazon's recommended fix is to use Lambda@Edge to rewrite the path when it gets the file from S3.
The response should be cached by Cloudfront, and only invoke the lambda on cache misses.
Acceptance Criteria
Directories serve index.html with /
Given I have a directory foo with an index.html file
When I try to access the directory example.com/foo/ (with trailing /) via cloudfront
Then I am served the foo/index.htmlfile
Directories serve index.html without /
Given I have a directory foo with an index.html file
When I try to access the directory example.com/foo (without trailing /) via cloudfront
Then I am served the foo/index.htmlfile
Doesn't work without index.html
Given I have a directory foo without an index.html file
When I try to access the directory example.com/foo (without trailing /) via cloudfront
Then I am served the error page
Named files don't work as directories
Given I have a file foo.html
When I try to access the example.com/foo via cloudfront
Then I am served the error page
Named files don't work as directories with /
Given I have a file foo.html
When I try to access the example.com/foo/ via cloudfront
Then I am served the error page
Named files continue to work as files
Given I have a file foo.html
When I try to access the example.com/foo.html via cloudfront
Then I am served the /foo.html
The text was updated successfully, but these errors were encountered:
There is a current limitation with this template where all paths must be referenced by the full file name, and not the directory name.
e.g a site with the path
/foo
where/foo/index.html
exists, does not serve theindex.html
file and instead responds with the error file.This is due to a limitation with Cloudfront, and the workaround is to use the bucket's web facing url, and point Cloudfront at the web origin instead of as an S3 origin. See this stackoverflow question.
Amazon's recommended fix is to use Lambda@Edge to rewrite the path when it gets the file from S3.
The response should be cached by Cloudfront, and only invoke the lambda on cache misses.
Acceptance Criteria
Directories serve index.html with /
Given I have a directory
foo
with anindex.html
fileWhen I try to access the directory
example.com/foo/
(with trailing/
) via cloudfrontThen I am served the
foo/index.html
fileDirectories serve index.html without /
Given I have a directory
foo
with anindex.html
fileWhen I try to access the directory
example.com/foo
(without trailing/
) via cloudfrontThen I am served the
foo/index.html
fileDoesn't work without index.html
Given I have a directory
foo
without anindex.html
fileWhen I try to access the directory
example.com/foo
(without trailing/
) via cloudfrontThen I am served the error page
Named files don't work as directories
Given I have a file
foo.html
When I try to access the
example.com/foo
via cloudfrontThen I am served the error page
Named files don't work as directories with /
Given I have a file
foo.html
When I try to access the
example.com/foo/
via cloudfrontThen I am served the error page
Named files continue to work as files
Given I have a file
foo.html
When I try to access the
example.com/foo.html
via cloudfrontThen I am served the
/foo.html
The text was updated successfully, but these errors were encountered: