Setting up a CNAME for an S3 bucket using Amazon Route 53

后端 未结 3 1688
时光取名叫无心
时光取名叫无心 2021-02-06 13:31

I need the following url

http://liangpai.s3.amazonaws.com/uploadImage/shareImage/2012-10/506dc1ef71dcf.png

showing as:

http://imgs.liangpai.me/uploadImag

3条回答
  •  既然无缘
    2021-02-06 14:19

    Method 1 : S3 direct CNAME by bucket name

    You can create a CNAME record by bucket name following these steps.

    1. Create a bucket name using the same name you will use for your dns entry. i.e. subdomain.mydomain.net

    2. Create a cname record for subdomain.mydomain.net to s3.amazonaws.com

    3. Set permissions on your bucket based on the access you plan to grant

    Method 2 : Static Website on S3

    If you are serving static content such as images, files, etc. you can use "Static Website Hosting" for your S3 bucket.

    Select your bucket by clicking the bucket icon (enter image description here) and select the "properties" tab on the right and expand "Static Website Hosting". In the Static Website Hosting panel, select the radio button to "Enable website hosting" and set an index and error document. It this point, you will see an "Endpoint" name in this panel. Simple create a DNS CNAME record with the endpoint as the value. You can read the entire Amazon Walkthrough here.

    enter image description here

提交回复
热议问题