gatsby 404.html 页面返回状态 404 而不是 200

时间:2021-01-11 12:15:16

标签: amazon-s3 amazon-cloudfront

我使用 aws cloudfront + s3 存储桶托管 Gatsby 站点,

如果我尝试访问错误的路径,我会得到 404,这很好 例如:www.mysite.de/blabla -> 返回我的自定义 404 页面,状态为 404。

现在如果我打开 www.mysite.de/404.html 这也将返回我的自定义 404 页面但状态为 200 。 我也试图返回 404 而不是 200,但我无法完成这项工作,有人可以帮忙吗?

我尝试重定向到 404,但在 lambda 边缘查看器请求事件中找不到描述,但这导致 gatsby page-data.json 出现问题,页面卡住没有反应。

您可以在此处查看问题 https://www.gatsbyjs.com/404.html

谢谢

0 个答案:

没有答案