title: AWS Cloudfront and S3 hosting for angular app
body: <p>I am trying to deploy an Angular app, which is essentially a web-site client that makes API calls to a backend server and then display the data. </p>
  
  <p>I tried using S3 static hosting for hosting this site by uploading the production build <code>dist</code> folder generated by <code>ng build --prod</code>. </p>
  
  <p>The S3 static hosting seems to work fine with all the functionalities even though the Angular app seems to be a dynamic site. I was aware that Angular build can transpile the app to static assets. </p>
  
  <p>However, I run into problems when I try to add AWS Cloudfront on top of the S3 static hosting. In particular, when accessing the site via Cloudfront, the site is unable to display data fetched from the backend server.</p>
  
  <p>Any reasons or solution to why the Cloudfront is acting differently than the S3? I think that Cloudfront and S3 are not designed to host dynamic site, but I am wondering why is it that the S3 static hosting by itself seems to work just fine.</p>