简体   繁体   English

如何将域类别设置为AWS EC2

[英]How to setup domain category to AWS EC2

I have 2 server AWS EC2 (EC2-A, EC2-B). 我有2个服务器AWS EC2(EC2-A,EC2-B)。

Now, I have 1 domain http://my-domain.com call to website in EC2-A (/var/www/html/website1). 现在,我在EC2-A(/ var / www / html / website1)中有1个域http://my-domain.com呼叫网站。

I want setup domain category http://my-domain.com/category call to website in EC2-B (/var/www/html/website2). 我想在EC2-B(/ var / www / html / website2)中设置对网站的域名类别http://my-domain.com/category调用。

Can I do it? 我可以做吗?

I am not a master on this subject, but I would most likely use one of the following approaches: 我不是该主题的专家,但是我很可能会使用以下方法之一:

  1. If possible, use category.my-domain.com and then make the DNS server point to the correct EC2 instance; 如果可能,请使用category.my-domain.com ,然后使DNS服务器指向正确的EC2实例。 or 要么
  2. Use a NAT instance that redirects the traffic to the correct instance based on the url pattern. 使用NAT实例,该实例根据url模式将流量重定向到正确的实例。 That is, all requests would be made to the NAT instance, which in turn would forward it to the correct instance. 也就是说,所有请求都将发送到NAT实例,然后将其转发到正确的实例。 To achieve that I would probably choose haproxy and do something like explained here . 为了达到这个目的,我可能会选择haproxy并做一些像这里解释的事情

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

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