How to stop CloudFront from redirecting to S3 bucket.
I have an Amplify Hosting frontend that uses a rewrite redirect (200) to redirect to an S3 bucket. That worked out fine but then I created a CloudFront distribution and since then, the rewrite gives a timeout after 30 seconds serving a 504 error. That is why I disabled and then deleted the CloudFront distribution. However the timeout and 504 error (coming from CloudFront) is still there. Any ideas how to fully remove this CloudFront forwarding or do I have to delete the bucket/frontend?
Hi there,I understand you want to delete CloudFront distribution because of 504 error you keep on getting.Please correct me if I misunderstood.
To further understand the issue when getting a 504 error or timeout it indicates that when Cloudfront forwarded a request to the origin ,one of the following might have happened: [1]The origin returned an HTTP 504 status code to CloudFront. [2]The origin didn’t respond before the request expired.
Cloudfront will return an HTTP 504 status code if traffic is blocked to the origin by a firewall or security group if the origin isn’t accessible on the internet.Check for these issues first.If access isn’t the problem with your CloudFront check application delays and server timeouts, using link [3] to help you identify and fix the issue.I would also recommend changing the timeout value to 60 seconds.
However if you no longer want to use a CloudFront distribution, you can delete it by using the CloudFront console or by using the CloudFront API.Please make sure that you have disabled distribution before deleting it.For more instructions on how to delete CloudFront distribution ,use this link for the console [4] and this link [5] for the CloudFront API
I hope the above information is helpful.
Reference
[3]https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-504-gateway-timeout.html#http-504-gateway-timeout-configure-firewall [4]https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowToDeleteDistribution.html [5]https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_DeleteDistribution.html
Relevant questions
"Bucket name already exists", but it is not listed on the S3 Mgmt Console
asked 4 years agoHow can I (use AWS GoLang SDK to) create an io.writer (pipe) that will write buffers to a AWS S3 bucket file?
asked 3 months agoHelp with S3 redirect
Accepted Answerasked 3 months agoOAI or not OAI for serving a static website in S3 using CloudFront
asked 3 months agoRedirect S3 URL to Domain URL
asked 22 days agoStatic bucket redirect requests append index.html to homepage URL
asked 2 years agoS3 Static Website RoutingRules when using Cloudfront and a domain name
asked 3 years agoHow to stop CloudFront from redirecting to S3 bucket.
asked a month agoVirtual hosting an S3 bucket using Cloudfront + SSL
asked 3 years agoHow to Migrate from existing S3 bucket to AWS Amply
asked 2 years ago