I have my domain names pointed at cloudfront, which in turn references my EC2 instance using a custom origin. In this case it is the public dns name from EC2 like xxxxx.us-west-2.compute.amazonaws.com. This makes it behave like a reverse proxy.
I have a form that takes user information so I would like to set up SSL. Because my main domain points to cloudfront,
How do I set up the relationship between cloudfront and the EC2 instance, when using CF like a reverse proxy cache and the EC2 instance is a custom domain.
Would I do this:
- Create a subdomain for my origin, for example "origin.mydomain.com"
- Get a SSL cert for origin.mydomain.com
- Set origin.mydomain.com as the origin in cloudfront, as opposed to the instance domain created by amazon. (Not xxxxx.us-west-2.compute.amazonaws.com)
Edit: Modified title and some body for clarity.