How can I serve multiple domains from a CloudFront distribution over HTTPS?

2 minute read

I want to serve multiple domains from an Amazon CloudFront distribution over HTTPS.


To serve multiple domains from CloudFront over HTTPS, add the following values to your distribution settings:

  • Enter all domain names in the Alternate Domain Names (CNAMEs) field. For example, to use the domain names and, enter both domain names in Alternate Domain Names (CNAMEs).
    Note: Choose Add item to add each domain name on a new line.
  • Add your SSL certificate that covers all the domain names. You can add a certificate that's requested with AWS Certificate Manager (ACM). Or, you can add a certificate that's imported to either AWS Identity and Access Management (IAM) or ACM.
    Note: It's a best practice to import your certificate to ACM. However, you can also import your certificate in the IAM certificate store.

For each the domain name, configure your DNS service so that the alternate domain names route traffic to the CloudFront domain name for your distribution. For example, configure and to route traffic to

Note: You can't use CloudFront to route to a specific origin based on the alternate domain name. CloudFront natively supports routing to a specific origin based only on the path pattern. However, you can use Lambda@Edge to route to an origin based on the Host header. For more information, see Dynamically route viewer requests to any origin using Lambda@Edge.

Related information

Values that you specify when you create or update a distribution

Using custom URLs by adding alternate domain names (CNAMEs)

AWS OFFICIALUpdated 7 months ago

can i use Alternate Domain Names to redirect it to different origin ? for example: > point to X s3 bucket (using origin X) > point to Y s3 bucket ( using origin Y)

under the same distribution

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

Hi, I am interested in the question by Hany too. May I know is it already updated in Knowledge Center article?

The presented solution limits the number of domains to the max that a certificate can contain (10 per AWS cert by default). I have a situation where I may have thousands of domains all pointing to a multi tenant system. Can CloudFront be used in such a situation? without creating many certs and CloudFront distros.

Thank you for your comment. We'll review and update the Knowledge Center article as needed.