简体   繁体   中英

Main domain for AWS S3 static hosting and sub domain for api

I purchased a domain from godaddy.com and I'd like to use the root domain for AWS S3 static hosting and sub domain for api.

The API server is running on an AWS EC server.

So the result should be:
- when enter mydomain.com in the browser: I should see the AWS S3 static hosting page.
- when I make a request to api.mydomain.com: all requests should be sent to AWS EC2 server.

I tried http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

As a result, the S3 hosting is working with the root domain.
But in my Godaddy domain settings page, I can't add a subdomain because the name servers are not managed by Godaddy.

Since you mention that the name servers are not managed by Godaddy, I assume that you are using AWS Route53 service. If so, that is where you should add all needed records/subdomains.

Also, by using Route53 with other AWS services, you can utilize additional benefits compared to other name service providers (ALIAS records).

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