Hacker News new | ask | show | jobs
by somethingAlex 820 days ago
If you are using Cludfront with an S3 origin you can turn on static website hosting and specify a 404 fallback page[0] - which would then just be your index file. It will render your client code and let you show a 404 if it is indeed one.

The problem is that essentially every time a user goes to the site it will be a 404 status code since they are probably not typing in example.com/index but this has pragmatically not been an issue for a wholly authenticated, private, B2B SaaS app. The marketing website is a separate subdomain.

For a public site this is probably worse than returning 200s that should be 404s occasionally, though.

[0]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/Custom...