serverless-nextjs / serverless-next.js

⚡ Deploy your Next.js apps on AWS Lambda@Edge via Serverless Components
MIT License
4.48k stars 456 forks source link

Deploy to multiple domains? #1870

Open dionrussell opened 3 years ago

dionrussell commented 3 years ago

Is there away to deploy the same script to multiple domains? (e.g. abc.com, def.com, ghi.com)

dphang commented 3 years ago

I don't do it myself but I believe you should be able to follow something like https://aws.amazon.com/premiumsupport/knowledge-center/multiple-domains-https-cloudfront/ - basically don't setup a domain through this component - instead create an ACM cert outside of this (manually, using Terraform, etc.) and add multiple CNAMEs and you can use the certificate input to point to that certificate. Then you'd just need to configure the DNS records (Route53 or whatever domain manager you use) to point to the CloudFront URL