Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29243

How to set up SSL with CloudFront for EC2 Instance (Wordpress)

$
0
0

I followed this guide to setup WordPress on EC2, but it doesn't cover how to enable HTTPS. I've used the 'WordPress Certified by Bitnami and Automattic' AMI.

I know I can use CloudFront infront of EC2 for SSL, but I'm having trouble getting it working. I've gotten Error 502 plus several others. So I'd like to start from scratch and confirm my approach is correct.

I've registered my own domain (example.com). In Route 53, I have 'blog.example.com' as an A record pointing to my instance's EIP. I also have a CNAME record for 'www.blog.example.com' pointing to 'blog.example.com'. Both URLs can access my instance via HTTP.

  1. In CloudFront's configuration, my 'Origin Domain Name' is:

    • Public DNS (ec2-XX-XX-XX-XX.ap-southeast-2.compute.amazonaws.com)
  2. 'Origin Protocol Policy' is set to HTTP

  3. 'Viewer Protocol Policy' is set to 'Redirect HTTP to HTTPS'.

  4. For SSL Certificate, I've requested a custom cert for both:

    • blog.example.com
    • www.blog.example.com

All other CF settings have been left as default. I can access the distribution's domain name but its still HTTP.

After the Distribution is deployed, I've change the 'blog.example.com' record in Route 53 to have an alias target of CF's domain name (xxxxxxxxxxx.cloudfront.net).

  • What about the CNAME record (www.blog.example.com), should it be amended aswell?

Up to this stage, I can access both 'www.blog.example.com' and 'blog.example.com' but its HTTP and the EIP appears in the URL bar, not domain names.

What am I missing or have setup incorrectly?

I'm super new to AWS so many thanks in advance!


Viewing all articles
Browse latest Browse all 29243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>