S3 static hosting link doesn't work while the object url works, static hosting page is an empty page

0

I use React+ Tailwind+ JS to develop a web. I can use the object url to open my page, I set up my budget policy, and enable the static hosting, so what's wrong with S3. Does S3 static hosting doesn't support React+Tailwind

Enter image description here Bucket Policy Enter image description here S3 Enter image description here

cnguzx
gefragt vor 3 Monaten183 Aufrufe
2 Antworten
2
Akzeptierte Antwort

Hey, I have used S3 hosting for React + Tailwind applications many times.

One issue that I've encountered in the past is the domain name. You need to attach a domain to the S3 bucket or else the relative paths will be problematic.

My general path for React + S3 Hosting is the following.

  1. S3 bucket (but change the bucket name to the name of the domain to be used. This could be part of what's causing headache. It's also a good practice)
  2. CloudFront distribution (you'll want SSL & just makes life easier for these types of projects)
  3. Point Domain DNS to CloudFront distribution via Route53 or whatever DNS provider you use.

This should get you a React + Tailwind app up fairly easily

BUCKET POLICY You can go to the following URL and this section if you want to only allow access to the files through domain & cloudfront. Look for title "Example S3 bucket policy that allows read-only access to a CloudFront OAC" https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html

profile picture
beantwortet vor 3 Monaten
profile picture
EXPERTE
überprüft vor 2 Monaten
0

I don't know for some reason, After I cleaned my browser cache, and I was able to open it

cnguzx
beantwortet vor 3 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen