My domain (example.com
) is registered with name.com. Domain's NS are pointed to AWS Route 53 name servers. My WordPress is hosted at siteground and having IP address (1.1.1.1
example) and a subdomain (aws.example.com
) is created at siteground.
In my AWS CloudFront distribution, Origin domain is pointed to aws.example.com
since it will not accept the IP address.
In Route 53, aws.example.com
A record points to IP (1.1.1.1
from siteground). And example.com
& www.example.com
's A & AAA records point to AWS CloudFront distribution name (d1111abcd8.cloudfront.net
example).
Above configuration return 502 error for both domain name and CloudFront distribution name. (Error: CloudFront wasn't able to connect to the origin).
How can I make this configuration work while I use example.com
as public domain with CloudFront?
CloudFront configuration:
Supported HTTP versions: HTTP/2, HTTP/1.1, HTTP/1.0
Alternate domain names: www.example.com, example.com
Custom SSL certificate: Yes, issued by AWS ACM
Origin domain: aws.example.com
Protocol: HTTP only
No additional CF configuration
Can you access aws.example.com from a browser?
Does it accept HTTP (non-secure) traffic?
yes, I can access aws.example.com. but it shows a blank page from cloudfront hosting and is a HTTP page. When I ping aws.example.com, it returns the valid server IP.
Which 502 error is it? https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/troubleshooting-response-errors.html
No more 502 error. Now the "Under Construction" page is shown by SiteGround since the CloudFront Origin domain is aws.example.com. This subdomain
aws
does not have any content.