title: Two different AWS applications on the same domain with a different subfolders
body: <p>Based on this issue <a href="https://stackoverflow.com/questions/34364311/cas-server-cross-subdomain-st-ticket">CAS server cross subdomain ST ticket</a> I'm thinking about changing of my applications urls.</p>
  
  <p>I have two applications on the following subdomains</p>
  
  <p><code>https://ui.example.com</code> - static AngularJS application(JavaScript, HTML) hosted on Amazon S3 </p>
  
  <p><code>https://api.example.com</code> - Java Spring application hosted on Amazon EC2 instances (for Tomcat) with Elastic Load Balancing that distributes incoming application traffic across multiple Amazon EC2.</p>
  
  <p>Right now I need to change urls of my applications to the following:</p>
  
  <pre><code>https://ui.example.com
  https://ui.example.com/api
  </code></pre>
  
  <p>In other words I need to make <code>api.example.com</code> application available as <code>/api</code> subfolder of my <code>ui.example.com</code> domain.</p>
  
  <p>How it can be configured with AWS ? Where at AWS I need to make an appropriate changes and configuration ?</p>