Angular S3上的角度,刷新原因“;“拒绝访问”;响应
我有一个angular 5应用程序,我一直在本地运行,在heroku上用NodeJS服务器运行很好,但是当我把它放在一个S3存储桶中,在cloudfront后面,点击refresh,我得到了这个Angular S3上的角度,刷新原因“;“拒绝访问”;响应,angular,amazon-s3,amazon-cloudfront,Angular,Amazon S3,Amazon Cloudfront,我有一个angular 5应用程序,我一直在本地运行,在heroku上用NodeJS服务器运行很好,但是当我把它放在一个S3存储桶中,在cloudfront后面,点击refresh,我得到了这个 This XML file does not appear to have any style information associated with it. The document tree is shown below. <Error> <Code>AccessDenied
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>217...1C</RequestId>
<HostId>
yu2de...dr0=
</HostId>
</Error>
有什么建议吗?您需要配置Cloudfront来处理路由,以便将所有路由重定向到
index.html
查看更多信息如果您正在开发中进行简单的HTML S3站点测试,并使用默认分配的域(不使用cloudfront),请将错误页设置为与起始页(index.HTML)相同。然后,当页面刷新时,它会以相同的路径重新加载,就像传统的不是SPA的网站一样。只有当你点击刷新时才会这样吗?你在使用路由吗?如果是这样的话,请看一下PERFECT!-发布作为答案,我将投票并选择——这正是我所需要的。