javaspring-bootdockerspring-mvcamazon-ec2

How can I multiple two spring boot web applications on same port with different endpoints?


I have two spring boot web applications. I want those applications to be deployed on same port with different endpoints, like

I am trying to deploy these applications using docker in AWS EC2. Please let me know how to do this.

Thank you!

When I tried to deploy two applications on same port, it failed.


Solution

  • Having two apps running on the same port on a single machine is impossible. However, you can run applications on each port and combine them using Nginx. Example: