I've set up a new domain and web server, and a CloudFront distribution to serve it.
CloudFront is successfully serving the site on its own domain: d1lnegrqin0up5.cloudfront.net
I want mpe.io (without www) to go to the web server, and www.mpe.io to go to the CloudFront distribution. As such, I set up a CNAME record for www.mpe.io pointing to the aforementioned CloudFront domain.
I gave it a couple of hours, and www.mpe.io goes to CloudFront (it says "Generated by cloudfront" on the resulting pages) but all requests simple result in a Bad request ERROR.
Note that if I go directly to the CloudFront domain, everything works fine. How can I get www.mpe.io successfully serving files in the same way the CloudFront domain is?
Specifics:
Domain DNS records:
Distribution settings:
To resolve the Request Blocked error when the default action is Allow, review the requests to be sure that they don't match the conditions for any AWS WAF rules with Action set to Block. If valid requests match the conditions for a rule that blocks requests, then update the rule to allow the requests.
CloudFront fails over to the secondary origin only when the HTTP method of the viewer request is GET , HEAD , or OPTIONS . CloudFront does not fail over when the viewer sends a different HTTP method (for example POST , PUT , and so on).
CloudFront domain names are unique. Your distribution's domain name was never used for a previous distribution and will never be reused for another distribution in the future.
All good! I answered my question as I was writing it.
It was that field regarding Alternate Domain Names (CNAMEs) in the distribution's settings. When I added www.mpe.io as one of them and gave it some time, it ended up working fine.
You made my day. The moment I added www.domain in the CloudFront Distributions, iI recognizes the web.
I also tried with one subdomain to test and added CloudFront URL in CNAME in GoDaddy and subdomain entered in CloudFront Distributions and it also works.
I added the snapshot of CloudFront for amateurs like me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With