By using AWS re:Post, you agree to the Terms of Use

CloudFront: Forward headers to HTTP GET endpoint

0

Hello, I'm having problems setting up CloudFront.

I'm using it as a layer in front of my API which currently uses the Authorization header for every request, so I don't want to enable caching. Everything works great for POST endpoints, the header is forwarded and if authentication fails, the JSON response with the error is returned. But for GET endpoints the Authorization header doesn't seem to be forwarded and only a "403 ERROR The request could not be satisfied." error from CloudFront is returned. I'm using the following cache settings: Screenshot of cache settings I want both the header to be forwarded and the JSON error response from the server to be returned if authentication fails

  • I confirmed that with the same settings as you have depicted in your picture, I am able to use both POST and GET methods and the Authorization header is making it to the origin. I'm not setup to do anything with the header, but I can confirm it reaches the backend target. Can you provide more details of your setup, such as what kind of origin?