Score:0

Cloudfront 502 error with ALB origin in different region

cn flag

I have a CloudFront which has one of its origins as an application load balancer, this load balancer is available in a different region from the CloudFront which is only available in N.Virginia and is using a different SSL certificate, as its domain name is different. I need to have this alb in its region and can't move it to N.Virginia as well. I am not sure why I am getting the 502 error on the CloudFront domain.

When I visit the A Record DNS Name provided in the load balancer description tab it still does not work, so I think the error is with the load balancer but I am not sure, as the domain name to which the load balancer is supposed to route traffic is working.

I am new to AWS and this is all the information I could think of, so please let me know if any more information is needed.

I am sorry if I am confusing you but this is my first time working on AWS, and I don't have any terminology down yet, I will immediately clear things up if you ask me something.

Score:0
us flag

Typical reasons for this can be the following

  1. CNAME record for the certificate not set correctly -> go to Certificate Manager, select your certificate and in the tab "Domains" click "create records in Route53
  2. ALB is not internetfacing -> when using CloudFront is must be internetfacing. Go to EC2 -> Load Balancing and select your Target / Origin Load Balancer. You can also check the DNS name of it there and try to access it directly. If the direct call works, your ALB is fine, but the Cloudfront connection with ALB is bad :)
  3. CloundFront is not having the certificate (and it is mandatory for CloudFront to have Certificate in No. Virginia) or the "Alternate Hostenames" is not set correctly (which should be your Domain name and eventually *.YourDomainName)

Hope it helps to point you to the right way :)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.