|
Hey I'm fuckin dumb and have no idea what I messed up, hopefully this is the right place to ask questions. I'm making a test site using CloudFront/S3 and I can't get them to cooperate. I have my simple site data in an S3 bucket, I made sure to enable static website hosting, and I made sure to enable read permissions code:
code:
The issue I'm having is it seems to load up the main page fine, but when it accesses any directories in the fart bucket it comes back with Access Denied, even if there's nothing in the directory but an index.html file. What is going on? Is it a path problem? I tried appending /* to the origin path but then it wouldn't even load the main page. Sorry if this is a dumb question, I'm teaching myself as I go and it's a lot of trial and error.
|
# ¿ Feb 9, 2017 22:05 |
|
|
# ¿ May 3, 2024 13:14 |
|
So I know the S3 is fine because using the S3 URLs everything works as expected. It must be something with the CloudFront setup. Basically the site is totally barebones: an index.html for the homepage, then an "about" directory and a "contact" directory, each with an index.html file inside. Right now CloudFront can access the main page fine but gives Access Denied errors for everything else. https://www.fartexample.com works, https://www.fartexample.com/contact/ doesn't work, https://www.fartexample.com/contact/index.html doesn't work. I'll try posting in the AWS forum too but I've tried changing every little setting one at a time and waiting for the full deployment and nothing seems to do anything.
|
# ¿ Feb 10, 2017 19:12 |
|
I figured it out, posting the answer in case anyone else has the same problem. Turns out I was using the default S3 bucket naming convention that popped up in the CloudFront Origin settings, but that disables the normal behavior where it looks for index.html inside directories. By changing that to the full S3 bucket name found under "Static Web Hosting" in the S3 control panel, it fixed the forwarding and it works normally now.
|
# ¿ Feb 11, 2017 21:39 |