Java – name based virtual host using spring boot

I am looking for the best way to host multiple websites developed using spring boot

I have a public IP that points to the EC2 machine

I am running a web application developed using spring boot

Now, I'm looking for a way to create my second spring boot application (running on different ports)

My configuration should be like this (single public IP),

www.app1.com(x.x.x.x) => Spring Boot App1
www.app2.com(x.x.x.x) => Spring Boot App2

I found many articles about the Internet dealing with conf / server XML file, http://tomcat.apache.org/tomcat-7.0-doc/config/host.html

Someone can help me achieve the same goal

Solution

The best approach may be to use a reverse proxy front end For example Install nginx on your EC2 box, or (it might be better if you take it seriously) use ELB and register your DNS records with route 53

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>