title: Can we run multiple spring boot applications in same port? If not, why we have the context path option in application.properties?
body: <pre><code>server.port=8080
  server.contextPath=/myapp
  </code></pre>
  
  <p>Consider the above configuration in the application.properties of a spring boot application. What is the need of contextPath if we can't really run another spring boot application in the same port 8080. Can anyone provide some real time scenarios where this contextPath useful? </p>
  
  <p>[edit]
  In my experience, when we deploy multiple web applications (web applications contexts) to single tomcat instance running on 8080 port the context path is used to distinguish the applications. This is what kept me thinking about the possibility of running multiple spring applications in a single port. Otherwise, I don't see the value of having an option to change the contextPath. Also considering the fact that we will have nginx or apache as a web server front and this spring applications are going to be run only inside the firewall.</p>