title: Serving REST API and static content from different ports with Spring Boot
body: <p>Is it possible to serve the REST API and the static content from different ports with Spring Boot? This becomes of interest when using CORS. Means, a plugged in nginx would route requests to <code>api.example.com</code> to one port and requests to <code>static.example.com</code> to another port. Example:</p>
  
  <p><code>GET :8080/index.html</code> should serve <code>src/main/resources/static/index.html</code><br>
  <code>GET :8090/customers/1</code> should serve content provided by a (e.g.) <code>CustomerController</code></p>
  
  <p>Requests with swapped port numbers (so 8080 for REST API, 8090 for static content) should not work.</p>
  
  <p>Level 1 answer: How to accomplish this with an Embedded Tomcat?<br>
  Level 2 answer: How to accomplish this with a Managed Tomcat in which the Spring Boot Application runs?</p>
  
  <p>Not a solution, because this is obvious: "Split it into two applications".</p>