Cyclic redirect with CloudFront
See original GitHub issueHello,
The Lambda function is working well, but I have cyclic redirect when trying to configure it with CloudFront.
I created a CloudFront distribution with default settings and used S3’s static website endpoint as the origin. Also, I used the CloudFront domain name for the URL
Lambda envonment variable.
Existing images are served well. But for new images I receive redirects loop between API gateway and CloudFront. What is interesting, new image generated and accessible with S3’s endpoint. Can’t get what is wrong.
Any ideas on how to fix it? Thank you.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How do I redirect a domain in CloudFront? - AWS
To redirect a domain in CloudFront, use one of the following: ... An Amazon S3 website endpoint redirection moves the existing URL path...
Read more >Redirect All HTTP request to HTTPS via CloudFront - YouTube
If you load your site via cloudfront, then you can follow these steps to ... The Http and the Web | Http Explained...
Read more >Use Lambda@Edge to handle complex redirect rules with ...
For our use case, we want to intercept the viewer request and redirect the user based on a set of path based rules....
Read more >Redirect traffic with CloudFront - Stack Overflow
You should create a new CloudFront distribution. The trick here is to NOT use the proposed bucket values, but use the endpoint directly....
Read more >ERR_TOO_MANY_REDIRECTS · Cloudflare SSL/TLS docs
Redirect loops will occur if your origin server automatically redirects all HTTP requests to HTTPS.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, browser redirects to API gateway again. The problem in CloudFront cache behavior ( https://docs.aws.amazon.com/en_us/AmazonCloudFront/latest/DeveloperGuide/http-3xx-status-codes.html)
Fixed by setting up CloudFlare distribution Cache Default TTL to 0 and added CacheControl to images created by Lambda:
Cool, thank you for sharing. Hope this helps others