Cloudfront custom-origin distribution returns 502 “ERROR The request could not be satisfied.” for some URLs

后端 未结 14 2606
旧巷少年郎
旧巷少年郎 2020-12-07 15:32

We have a Cloudfront distribution with custom origin that has been working just fine for quite a long time, serving static assets for one of our sites. Just this morning, we

14条回答
  •  执念已碎
    2020-12-07 16:10

    I just went through troubleshooting this issue, and in my case it indeed was related to redirects, but not related to incorrect settings in my CloudFront Origin or Behavior. This will happen if your origin server is still redirecting to origin URLs, and not what you have set up for your cloudfront URLs. Seems this is very common if you forget to change configs. For example lets say if you have www.yoursite.com CNAME to your cloudfront distribution, with an origin of www.yoursiteorigin.com. Obviously people will come to www.yoursite.com. But if your code tries to redirect to any page on www.yoursiteorigin.com you WILL get this error.

    For me, my origin was still doing the http->https redirects to my origin URLs and not my Cloudfront URLs.

提交回复
热议问题