title: AWS cloudfront - how to serve s3 and EC2 using single cloudfront?
body: <p>Is it possible to serve S3 and EC2 using single cloudfront? </p>
  
  <p>Steps I followed so far are - </p>
  
  <ol>
  <li>Deployed a react app on S3 bucket</li>
  <li>Deployed a nodejs app on EC2</li>
  </ol>
  
  <p>Both apps are running with their separate public DNS. I am trying to serve both apps using single cloudfront for example - </p>
  
  <p><a href="http://dyiqp9sog17kw.cloudfront.net" rel="nofollow noreferrer">http://dyiqp9sog17kw.cloudfront.net</a>  >> it should serve react app, it is working as expected. </p>
  
  <p>and </p>
  
  <p><a href="http://dyiqp9sog17kw.cloudfront.net/api" rel="nofollow noreferrer">http://dyiqp9sog17kw.cloudfront.net/api</a> >> Here I want to run my node app from EC2 but it is throwing <strong>Access Denied</strong> exception.</p>
  
  <p>I am not sure if it is possible or not. Please help!!</p>