Skip to content

Cloudfront Distribution through Route53 Hosted Zone 403 ERROR

0

My hosted zone is correctly configured, as I have been using it for a couple of months now. Double checked with whois mydomain.com Previously, I was using "mydomain.com" A record to route traffic to my cloud distribution, and "www.mydomain.com" to redirect to "mydomain.com", and I was getting the same 403 error. I read here to invert that, which I did, but when I go to "www.mydomain.com" now, I still get re directed to "mydomain.com". That's one of the issues I am facing. How long is the hosted zone supposed to take, to update? I have tried everything I could find online, especially this, to no avail.

  • Alternate CNAME is correctly configured:

    • both "mydomain.com" and "www.mydomain.com" have their own A and AAAA records configured in the hosted zone, which I did from Cloudfront's "Route domains to Cloudfront" button.
  • AWS WAF is configured on CloudFront distribution or at the origin. WAF is enabled by default, and I really think this is the problem.

    • I have updated the rules to only allow traffic from two countries (mine and neighbour), after setting all of them to "allow", for testing. I was getting the same 403 error.
  • Custom origin returns a 403 error: NOPE

What I have tried:

  • Viewer protocol policy: HTTP and HTTPS
  • Restrict viewer access: NO
  • Cache policy: Amplify-Default
  • Response headers policy: SimpleCORS
  • Security policy: tried all of them
1 Answer
1

DNS updates in Amazon Route 53 generally propagate within approximately 60 seconds. However, because global DNS resolvers may retain cached records for the duration of their configured TTL, changes can appear inconsistent for several minutes to several hours. In practice, a 403 error from Amazon CloudFront is rarely attributable to DNS propagation delays. Instead, it typically results from issues such as improperly configured Alternate Domain Names (CNAMEs), missing or invalid SSL/TLS certificate associations, or restrictive AWS WAF rules that block incoming requests.

https://repost.aws/knowledge-center/cloudfront-troubleshoot-403-errors

https://repost.aws/knowledge-center/route-53-propagate-dns-changes

https://stackoverflow.com/questions/46936101/aws-route-53-integration-with-cloudfront-error-403

EXPERT

answered 10 months ago

AWS
EXPERT

reviewed 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.