skip to Main Content

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.

2

Answers


  1. 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.

    Login or Signup to reply.
  2. 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 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search