CloudFront错误:此XML文件似乎没有与之关联的任何样式信息 [英] CloudFront Error: This XML file does not appear to have any style information associated with it

查看:117
本文介绍了CloudFront错误:此XML文件似乎没有与之关联的任何样式信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可在AWS S3和CloudFront上运行的React应用。当我从给定的URL访问应用程序时,它会很好地打开主页。当我使用导航栏上的按钮导航到另一个页面时,它可以正常打开页面。但是,如果我随后刷新页面,则会出现此错误:




如果我也遇到同样的错误尝试通过特定路径(例如 www.website.com/blog )导航到页面。



如果我直接从S3对象URL访问网站,则一切正常。页面重新加载,我可以使用直接路径打开页面。这使我相信问题出在CloudFront。但是我不知道从哪里开始调试该问题。



S3设置:

解决方案

您必须将S3索引URL和S3错误URL设置到索引页面。 p>

I have a React app that runs on AWS S3 and CloudFront. When I access the app from the given URL it opens the home page fine. When I navigate to another page using a button on the nav bar it opens the page just fine. But if I then refresh the page I get this error:

I also get that same error if I attempt to navigate to the page via a specific path such as www.website.com/blog.

If I access the website straight from the S3 object URL everything works just fine. Pages reload and I can use direct paths to open a page. This leads me to believe the issue lies in CloudFront. However I have no idea where to start in debugging that issue.

S3 setup:

解决方案

You have to set the S3 index url and S3 error url to your index page..try it

这篇关于CloudFront错误:此XML文件似乎没有与之关联的任何样式信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆