CORS Error when hitting from Cloudfront to API Gateway

0

We have added the CDN in front of API gateway, but when we are hitting from the Postman it is working fine, but from Frontend we are getting CORS error when we are passing Headers, in CORS we allowed those headers

2개 답변
1

Hi,

this article "CloudFront reverse proxy API Gateway to prevent CORS" https://www.rehanvdm.com/blog/cloudfront-reverse-proxy-api-gateway-to-prevent-cors may help you in fixing your issue.

If you want deeper support from re:Post community, you should provide more details about your issue: error messages, config, etc.

Best,

Didier

profile pictureAWS
전문가
답변함 10달 전
  • list of api when added with headers that time it is showing cors the header is set('x-api-key', 'xoGxDUvGcI7zzESs15ltz3H4nYzcbHtD17WB2JTz')

                    .set('source', 'Web')
    
                    .set('source-type', this.browserName);
    

    'x-api-key', source, source-type, Authorization'

    BE will recieve call from gateway only

    its just we lept cdn in front of gateway so if same request raised by FE it will reply from its cache rather than calling gateway again

0

Postman does not check or enforce cors mechanisms, as that is a browser native feature. Are you handling cors on backend side by allowing origins?

profile picture
전문가
답변함 10달 전
  • BE will recieve call from gateway only
    BE code already have cors policy * attached in common place its just we lept cdn in front of gateway so if same request raised by FE it will reply from its cache rather than calling gateway again

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠