title: AWS CloudFront works with HTTP, but HTTPS get error - The request could not be satisfied. CloudFront wasn't able to connect to the origin
body: <p>I'm triying to serve my server trough AWS CloudFront. But I have some issues.</p>
  
  <p><strong>Scenario</strong></p>
  
  <ul>
  <li>One EC2 instance that is able to serve http and https (TLS 1.2)
  
  <ul>
  <li>this site serves a self signed TSL certificate.</li>
  </ul></li>
  <li>One CloudFront distribution 
  
  <ul>
  <li>Origin pointing to EC2 with protocol marked as "Match Viewer"</li>
  <li>Behaviour set to do not cache and Viewer protocol policy- HTTP and HTTPS, Cache Based on Selected Request Headers :All</li>
  <li>Distribution serving HTTPS with an AWS Signed certificate.</li>
  </ul></li>
  </ul>
  
  <p><strong>What happens</strong></p>
  
  <ul>
  <li>Acessing EC2 directaly does serve the page with "invalid certificate" (as expected)</li>
  <li>Acessing CloudFront Url works to HTTP pages.</li>
  <li>Acessing CloudFront Url DOES NOT works to HTTPS pages... I got 502 error (CloudFront wasn't able to connect to the origin.)</li>
  </ul>
  
  <p><strong>What I expect</strong></p>
  
  <ul>
  <li>Acessing CloudFront Url working to HTTPS pages.</li>
  </ul>
  
  <p>What should I do to server my HTTPS content using AWS CloudFront?</p>