I am trying to access a html file which reside in the S3 from an ajax request and I got 403 error.
I read the AWS online that if I do such thing, I need to setup AWS CORS rules to fix the 403 error.
However, I have been trying two days and I don't have any luck. Here is my CORS configuration:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<ExposeHeader>XMLHttpRequest</ExposeHeader>
<AllowedHeader>x-csrftoken</AllowedHeader>
</CORSRule>
</CORSConfiguration>
And my HTTP request looks like:
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Access-Control-Request-He... x-csrftoken
Access-Control-Request-Me... GET
Connection keep-alive
Host xxxxxxxxx.cloudfront.net
Origin http://localhost:8000
User-Agent Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
Can anyone help me to see what I have missed?
Thanks!