How to point Amazon S3 bucket to test subdomain li

2019-03-03 21:24发布

问题:

Currently I'm using Amazon S3 bucket for my website like images.example.com .Today I also built a test subdomain for development purposes and it is served in develop.example.com

Now I want to use Amazon S3 bucket like develop.images.example.com or images.develop.example.com (I don't know which of them is correct)

Is it possible according to S3 restrictions?

Because Amazon says: You must have same bucket name with your subdomain. So I was create a bucket like images.example.com

and my cname record is: images.example.com.s3-website.eu-west-2.amazonaws.com

My webserver is Apache and runs on Ubuntu

How can reach to my images on my development subdomain?


Should I create a new cname record?

Should I do something on my virtual host file?

or what?

回答1:

To share static content from develop.images.example.com:

  • Create an Amazon S3 bucket called develop.images.example.com
  • Turn on static website hosting
  • Create a Route 53 A record for develop.images.example.com with Alias=YES and point it to your S3 bucket

This is the same process as you would have followed for images.example.com.