简体   繁体   中英

AWS route subdomain to s3 static hosting

Lets say I have a hosted zone - hostabc.com and have an SSL Acm on that hosted zone.

  1. I created a S3 bucket name static-site with static hosting - static-site.s3-us-east-1.amazonaws.com.
  2. I create a subdomain - static.hostabc.com and route the alias to the S3 bucket

However when I access to some of the assets static.hostabc.com/style.css. The address url wasn't set SSL on it. How do I resolve this?

Unfortunately, you can't use an SSL certificate with an S3 static website and a custom domain.

I would recommend using AWS CloudFront to handle this. You can point your sub domain to the CloudFront Distribution, which in turn resolves to your S3 static website. You can associate a CloudFront Distribution with an SSL certification in ACM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM