Is it possible for an application load balancer to route to an s3 bucket to host a static website? The same alb would also route to apigateway via a vpc endpoint.
Question posted in Amazon Web Sevices
The official Amazon Web Services documentation can be found here.
The official Amazon Web Services documentation can be found here.
2
Answers
As far as I know, this isn’t possible.
Take a look at Cloudfront instead:
https://docs.aws.amazon.com/cloudfront/index.html
Use your S3 bucket and the ALB as origins in your setup.
It’s possible with vpc 3s interface endpoint.
https://aws.amazon.com/blogs/networking-and-content-delivery/hosting-internal-https-static-websites-with-alb-s3-and-privatelink/
Major problem with this approach through is that interface endpoint uses s3 REST API. Which means that you couldn’t specify fallback to your
index.html
in case of 404 errors. This means that if you host your SPA code and user enter in a browserhost:port/some/logical/path/within/your/app
you will get XML 403 or 404 error instead of servedindex.html
.And this problem makes this feature almost non-usable, if you have a requirement to allow bootstarp of your apps from deep links