Skip to content

cloudfront distribution error 504

0

I created a distribution for cloudfront to link a secure SSL certificate to my domain, I accessed the instance without problems, but the URL after distributing the instance in cloudfront returns 504.

distribution: d1uc0mlbenq529.cloudfront.net Instance: ec2-18-234-142-54.compute-1.amazonaws.com

Thanks for your help

4 Answers
2

Hello.

A 504 error in CloudFront indicates that access from CloudFront to the origin (EC2 in this case) has failed.
For example, what protocol did you choose when setting up the origin in CloudFront?
If you choose HTTPS, you need to enable HTTPS communication on EC2 and configure the web server to listen for HTTPS.
Please check the following document for troubleshooting instructions.
https://repost.aws/knowledge-center/cloudfront-troubleshoot-504-errors
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-504-gateway-timeout.html

EXPERT
answered a year ago
EXPERT
reviewed a year ago
1

Hey Riku, thanks a lot. Make sense your reply, I try it and let you know...

answered a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago
0
Accepted Answer

Yes, an SSL certificate is required to communicate over HTTPS.
However, since the domain "amazonaws.com" is managed by AWS, a certificate cannot be issued using Let's Encrypt, etc.
I think you need to buy your own domain and set up a certificate or create a self-cert.

EXPERT
answered a year ago
  • Thanks for your reply, I have fixed the issue, from de distribution CloudFront redirects only the HTTP traffic to HTTPS domain, and works!

0

It doesn't work, I think I did everything, the problem is with the HTTPS for ec2 Public IPv4 DNS, it's broken I put the firewall in the PHP server for both ports, and put the security groups for HTTPS, but I can't access the HTTPS for the ec2

Maybe, do I have to set the certificate to the ec2 DNS as well?

Enter image description here Enter image description here

works: http://ec2-18-234-142-54.compute-1.amazonaws.com/ doesn't work: https://ec2-18-234-142-54.compute-1.amazonaws.com/

Enter image description here Enter image description here

answered a year 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.