Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
639 views
in Technique[技术] by (71.8m points)

amazon s3 - return status 404 instead of 200 for gatsby 404.html page

i have Gatsby site hosted with aws cloudfront + s3 bucket ,

if i try to access a wrong path i get 404 which is great for example : www.mysite.de/blabla -> return my custom 404 page with status 404.

now if i open www.mysite.de/404.html this will also return my custom 404 page but status is 200 . i am trying to also return 404 instead of 200 , but i cant make this work , can someone please help ?

i tried redirect to 404 with not found description inside lambda edge viewer request event , but that caused issues with gatsby page-data.json and the page stuck with no reaction .

you can see the issue here https://www.gatsbyjs.com/404.html

Thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...