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.
Asked
Active
Viewed 1,514 times
2
-
Consider CloudFront for this; you can add both the S3 and the ALB as origins. – ceejayoz Sep 19 '22 at 23:07
-
This may be a duplicate of https://stackoverflow.com/questions/57385706/using-a-s3-static-site-with-an-application-load-balancer – brunson Sep 19 '22 at 23:08
-
No it can't. Use CloudFront. – Marcin Sep 19 '22 at 23:28
2 Answers
3
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.

Christoph Fischer
- 107
- 9
1
It's possible with vpc 3s interface endpoint.
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 browser host:port/some/logical/path/within/your/app
you will get XML 403 or 404 error instead of served index.html
.
And this problem makes this feature almost non-usable, if you have a requirement to allow bootstarp of your apps from deep links

Ameba Brain
- 313
- 1
- 7