Private S3 website accessible only from corporate network

0

I am building an internal application that should only be accessible within my company's corporate network, and I do not have the ability to use CloudFront or a public hosted zone (not even if I use WAF and block access to corporate IPs) I am following this article: https://aws.amazon.com/blogs/networking-and-content-delivery/hosting-internal-https-static-websites-with-alb-s3-and-privatelink/ This works but only for a simple HTML website that has a single file as root object that is index.html I would like to host a website built using ReactJS and the above solution fails to serve that. After building the react code and uploading it to S3, the structure looks like this: index.html js/ css/ fonts/

When I try to access it, I get a blank screen. Can someone please advise how this can be done or if it's even possible to host a react web app using the above solution. The services I am planning to use --> internal load balancer, S3, private hosted zone, private API gateway, Lambdas inside VPC, or any other service as long as it is not accessible from outside the corporate network.

I am open to using other solutions if there is one as long as it does not involve cloudfront. Thanks in advance.

  • Did you find an answer for this? I am facing the same issue. Literally no errors reported (developers tools) while accessing the website. Just a blank one.

2 Answers
0

Hello.

I believe it is also possible to set up the URL you shared.
A common problem is that js and html do not specify the correct paths to each other and the website does not display.
Is it possible to check with the developer tools of a browser such as Chrome to see what specific errors occur when accessing S3?

What about starting EC2 or ECS if hosting in S3 is difficult?
This is more expensive than hosting in S3, but it is possible to host a private website with the same settings as before.

profile picture
EXPERT
answered 8 months ago
profile pictureAWS
EXPERT
reviewed 8 months ago
  • Hi, I agree, this is probably due to incorrect URLs in the app code (even if they are relative). In particular, I suggest to have a dedicated bucket for this and to place the root of the web site at the root of the bucket to avoid any issue due to the root path of the application code in the bucket that would have to otherwise include a folder path which may be source of problems.

0

Hello, another possible option is to deploy your corporate react app using ECS, and associate IT with an ALB internal type, of this way the traffic only will be granted inside the privet network, I created an example of how to deploy an ECS app using clopudformation https://github.com/4l3j4ndr0/aws-verfied-access-lab, I believe that would be helpful to achieve your requirement.

profile picture
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions