1 個回答
- 最新
- 最多得票
- 最多評論
2
Hi Hello:
Because you can successfully access the page, even though it only displays one screen due to the lack of necessary components, I initially judge that the permission configuration between your CloudFront and S3 is correct. Returning 403 under this architecture is not necessarily directly related to your permission error. If the object does not exist in the corresponding path, it may also cause your endpoint to return a 403 error.
From this test result, I suggest you check whether these objects exist in your S3 bucket.
s3://<Bucket_Name>/assets/index-DI9R-h8i.css
s3://<Bucket_Name>/assets/index-6R1LzD2S.js
I tried to access your site with path prefix /assets/
, and I can get a 200 code. So you might reference the object with the wrong path. Or you have to move the objects under the /assets/
folder in your s3 bucket.
已回答 1 個月前
相關內容
- AWS 官方已更新 3 年前
- AWS 官方已更新 9 個月前
- AWS 官方已更新 2 年前
Thank you for your response it's really helpful!
So I checked and those files do exist in my bucket but they aren't in an 'assets' folder as I don't have one in my S3 bucket. All my files are at the root level if that makes sense. I am a bit unsure where the /assets/ is coming from. For example, this is the S3 URI for one of the files s3://<Bucket_Name>/index-6R1LzD2S.js
Therefore, this URI DOES NOT exist "s3://<Bucket_Name>/assets/index-6R1LzD2S.js" in my bucket but I don't know where it is coming from and why the path for these files are being prefixed with "/assets/ as there is no assets folder in my S3 bucket.
In your
index.html
HTML file , we can see it define how browser to reference these js or css objects to render your home page. I don't know how you get this file, but you have to make sure the front end request path structure should align with your s3's path structure.btw, if you think my reply can help you move forward, you can mark my reply as
Accepted Answer
. I will be help me to get come credit on this community. Thanks.Hi Cat,
Just want to say thank you! Looking in my index.html file was the issue! I didn't realise that was the src for those two files and I was uploading the files individually instead of in the assets folder! Such an obvious oversight!