简体   繁体   中英

How to setup domain category to AWS EC2

I have 2 server 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).

I want setup domain category http://my-domain.com/category call to website in EC2-B (/var/www/html/website2).

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; or
  2. Use a NAT instance that redirects the traffic to the correct instance based on the url pattern. That is, all requests would be made to the NAT instance, which in turn would forward it to the correct instance. To achieve that I would probably choose haproxy and do something like explained here .

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