I have created an Amazon CloudFront distribution and updated CloudFront URL to pub/static and pub/media URLs to be fetched from CloudFront. JS, CSS and Images are working fine with CloudFront but xhr HTML template files not loading through CloudFront URL. It is showing 403 forbidden in the console but when I open the same URL in browser it works fine. I checked request header and it contains following two headers.
Access-Control-Request-Method: GET
Access-Control-Request-Headers:x-requested-with
I think this is something that is responsible for my problem. Anyone has any suggestions how do I resolve this. I am running my M2 website on Apache server.
Thanks