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