springboot指定上下文_Spring Boot sperate @Configurations用于多个应用程序上下文

该博客探讨如何在Spring Boot中运行一个应用程序并使其监听多个端口,以实现通过Apache将不同子域名转发到不同端口上的Spring Boot应用(Tomcat)。作者考虑使用Spring Profiles来区分不同应用程序上下文,并在启动时通过命令行参数指定端口和配置。
摘要由CSDN通过智能技术生成

I'd like to run one spring boot application but have it listen on multiple ports.

The aim is to be able to let an Apache forward multiple (sub-) domains to the spring boot application (Tomcat) on different ports. Example:

example.com/** -> PORT 8080

client.example.com/** -> PORT 8090

employee.example.com/** -> PORT 8100

As far as I understood from several threads on SO, I'm best off launching multiple @SpringBootApplication Annotated classes from one main class, right? (https://stackoverflow.com/a/25870132/1510659)

What I didn't grasp yet, is how to configure each one of those applications separately.

Let's say I have launched these three Applications as shown in the linked post above:

MainExampleApplication

ClientExampleApplication

EmployeeExampleApplication

Now, for example, I w

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值