简体   繁体   English

AWS S3静态托管的主域和api的子域

[英]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. 我从godaddy.com购买了一个域,我想将根域用于AWS S3静态托管,将子域用于api。

The API server is running on an AWS EC server. API服务器在AWS EC服务器上运行。

So the result should be: 因此结果应为:
- when enter mydomain.com in the browser: I should see the AWS S3 static hosting page. -在浏览器中输入mydomain.com时:我应该看到AWS S3静态托管页面。
- when I make a request to api.mydomain.com: all requests should be sent to AWS EC2 server. -当我向api.mydomain.com发送请求时:所有请求都应发送到AWS EC2服务器。

I tried http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html 我尝试了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. 结果,S3主机正在使用根域。
But in my Godaddy domain settings page, I can't add a subdomain because the name servers are not managed by Godaddy. 但是在我的Godaddy域设置页面中,我无法添加子域,因为名称服务器不是由Godaddy管理的。

Since you mention that the name servers are not managed by Godaddy, I assume that you are using AWS Route53 service. 由于您提到名称服务器不是由Godaddy管理的,因此我假设您正在使用AWS Route53服务。 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). 此外,通过将Route53与其他AWS服务一起使用,与其他名称服务提供商(ALIAS记录)相比,您可以利用其他好处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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