AWS:将子域指向不同的弹性 beantalk 环境 [英] AWS: Pointing sub-domains to different elastic beanstalk environments

查看:39
本文介绍了AWS:将子域指向不同的弹性 beantalk 环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Amazon AWS,我有两个 Elastic Beanstalk 环境.一个托管我的 React 客户端,另一个托管客户端的 Node.js API.

Using Amazon AWS, I have two Elastic Beanstalk environments. One hosts my React client, and the other hosts a Node.js API for the client.

我拥有 some-domain-name.com 并且我想使用两个子域:

I own some-domain-name.com and I would like to use two sub-domains:

  • app.some-domain-name.com
  • api.some-domain-name.com

我希望 app.some-domain-name.com 指向 React 环境,api.some-domain-name.com 指向 React 环境API 环境.

I would like app.some-domain-name.com to point to the React environment, and api.some-domain-name.com to point to the API environment.

是否有使用 Route 53 和托管区域的好方法?过去,我将不同子域上的流量重新路由到同一服务器上的不同端口.但是,我无法根据子域将请求路由到不同的服务器.谢谢!

Is there a great way to do this using Route 53 and hosted zones? In the past, I've rerouted traffic on different sub-domains to different ports on the same server. I have not, however, been able to route requests to different servers depending on the sub-domain. Thanks!

推荐答案

只需在您使用的任何 DNS 主机中创建 2 个 CNAME 记录,每个子域一个.这是使用 DNS 的最基本方式,因此任何 DNS 主机都会支持这一点,除非您已经在使用 Route53,否则不需要.

Just create 2 CNAME records in whatever DNS host you are using, one for each subdomain. This is the most basic way of using DNS, so any DNS host will support this, no need for Route53 unless you are already using it.

这篇关于AWS:将子域指向不同的弹性 beantalk 环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆