AWS S3上的Angular应用程序可以通过CloudFront解决除了索引路线以外的另一条路线吗?
我有一个在S3上托管的Angular应用程序。当我尝试直接进入myApp.com/items
的路线时,我会遇到403禁止错误。但是,当我从myApp.com
访问应用程序时,一切都还好,从应用程序可以导航到myApp.com/items
。我不明白为什么会发生这种情况。
我该如何做到这一点,以便可以直接访问myApp.com/items
之类的路线?
I have an angular app hosted on S3. When I try to directly go to a route like myapp.com/items
I get a 403 forbidden error. But when I access the app from myapp.com
everything is okay and from the app I can navigate to myapp.com/items
. I don't understand why this is happening.
How can I make it so that routes like myapp.com/items
can be accessed directly and not throw an error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在CloudFront分发上输入错误页面选项卡
然后创建一个新的错误响应以处理任何OTHE路由,然后将其重定向到index.html文件
On CloudFront distribution enter error pages tab
Then create a new error response to deal with any othe routes and redirect it to index.html file