简体   繁体   English

Amazon aws route53,将子域重定向到在特定端口下运行的 ec2 应用程序

[英]Amazon aws route53, redirect subdomain to ec2 app running under specific port

I have a domain name mydomain.com registered on amazon route 53.我在 amazon route 53 上注册了一个域名 mydomain.com。

I have an EC2 instance in which I installed a docker portainer image under 9000 port.我有一个 EC2 实例,其中我在 9000 端口下安装了一个 docker portainer 图像。

My docker image run perfectly under ec2 public ip address: http://xxx.xxx.xxx.xxx:9000我的docker镜像在ec2下完美运行 public ip 地址: http://xxx.xxx.xxx.xxx:9000

What I want now is to create a subdomain: portainer.mydomain.com and pointed it to my EC2 portainer instance.我现在想要的是创建一个子域:portainer.mydomain.com 并将其指向我的 EC2 portainer 实例。

When I try to create a new record set portainer.mydomaon.com and point it to my docker image instance I can't specify the port value.当我尝试创建新记录集 portainer.mydomaon.com 并将其指向我的 docker 图像实例时,我无法指定端口值。

I know I miss something, I'm on my beginning on DNS domains.我知道我错过了什么,我刚开始使用 DNS 域。

Route 53 is a DNS resolver. Route 53 是一个 DNS 解析器。 Its job is to resolve domain to ip address.它的工作是将域解析为 ip 地址。 It has nothing to do with port.跟端口没关系。 But there are some alternatives:但是有一些选择:

  1. Add a secondary ip to the instance to host multiple websites and bind them to port 80. You add an additional ip by attaching elastic.network interface (ENI).向实例添加一个辅助 ip 以托管多个网站并将它们绑定到端口 80。您可以通过附加 elastic.network 接口 (ENI) 添加一个额外的 ip。
  2. Add Application Load Balancer with host based routing (you will get much more control, you can even do path based routing as well).添加具有基于主机的路由的 Application Load Balancer(您将获得更多控制权,您甚至可以执行基于路径的路由)。 See: Listeners for Your Application Load Balancers - Elastic Load Balancing请参阅: 应用程序负载均衡器的侦听器 - Elastic Load Balancing
  3. S3 redirection ( Route 53 Record Set on Different Port ) S3 重定向( 不同端口上的 Route 53 记录集

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

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