- Newest
- Most votes
- Most comments
Hi there!
From the notes, I understand that you are currently getting a CloudFront 504 error after attempting to redirect your old domain to a new one. Please correct me if I am wrong.
Please note that CloudFront will return an HTTP 504 status code if traffic to the origin is blocked by a firewall or security group, or if the origin isn’t accessible on the internet. You can check [1] on how to configure the firewall on your origin server to allow CloudFront traffic. Since you mentioned that “Some visitors” are getting the error, I would suggest that you look for any firewalls or security rules that block traffic from CloudFront edge locations, based on the published IP address range. If your origin uses Elastic Load Balancing, review the ELB security groups and make sure that the security groups allow inbound traffic from CloudFront, check document in link [2].
Check for those issues first. Then, if access isn’t the problem, explore application delays and server timeouts to help you identify and fix the issues. You can check [3] for steps you can take to find performance issues and how to correct them.
I hope you find the above information helpful.
Have a great day ahead!
References:
[1] https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-504-gateway-timeout.html#http-504-gateway-timeout-configure-firewall [2] https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html [3] https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-504-gateway-timeout.html#http-504-gateway-timeout-slow-application
I'm getting same issue. I think it's something with the CloudFront configuration - tried a number of options with no luck so far.
3 domains in play:
- CloudFront custom hostname - adds HTTPS (ex: website.io)
- S3 website endpoint (CloudFront Origin - HTTP only): ex: website.s3-website-us-west-2.amazonaws.com
- Redirect hostname (ex: website.com)
Tests:
- PASS: https://website.io redirects to https://website.com
- PASS: http://website.s3-website-us-west-2.amazonaws.com redirects to https://website.com
- PASS: http://website.s3-website-us-west-2.amazonaws.com/anything redirects to https://website.com/anything
- FAIL: https://website.io/anything --> 504 ERROR
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 2 years ago