Search code examples
amazon-ec2httpscloudflare

Running HTTPS on EC2 Instance


I’m trying to use HTTPS on my EC2 instance.

Currently, my URL looks like this: 192.168.0.1:8443 and works great.

However, due to HTTPS requirements by Stripe and other applications, I need the url to look like this: https://dev.domain.com

I should add that I am using Cloudflare as my DNS Manager.

I’ve tried Googling how to set this up with no luck. Maybe I’m searching for the wrong thing.

Can someone help me achieve this setup?

Thank you in advance!


Solution

  • I ended up adding rules for ports 80 and 443 to my EC2 instance, and then telling Apache to listen on port 80 instead of 8443. This allowed me to remove the appended :8443 in the URL and I was able to copy the DNS info into Cloudflare as a CNAME and begin using my domain name. Before, I wasn’t able to use my server info as it had to have :8443 appended to the URL which Cloudflare doesn’t like.