I know there are 2 ways of creating Cloudfront Origin:
- paste website endpoint from s3 bucket itself;
- select s3 from the list.
Now, when I do #1 - my site seems to really work, but I have to make bucket public. And if I'm using CF distribution for testing, I don't want everyone to have access to files in the bucket. OK, I can restrict access to CF itself with WAF/IP list. This is great.
Next I want to allow access to s3 bucket only from CF. I've found that it's achievable using #2, and I've made it, but now I have only first page of Angular app working, which is, for example, login. After login, app redirects somewhere, say /page/authenticated, and I've got an error "specified key does not exist". I've found a beautiful answer explaining this situation.
But still, I don't uderstand, can I restrict access to s3 bucket while using s3-website endpoint? Or, if I want routing to work, I have to do s3 bucket public and no other variants?