title: How to prevent users from accessing an application deployed on Cloudfoundry
body: <p>How can I prevent users from directly accessing my web application on Cloudfoundry?</p>
  
  <p>For example: I deployed a spring application on Cloudfoundry, that can be accessed using url myapp.cloudfoundry.com  (this is just an example).</p>
  
  <p>Then, I use another web app, deployed on Google App Engine, that acts like a reverse proxy for the one deployed on cloudfoundry ( like in this example <a href="http://programming.mvergel.com/2011/11/cloud-foundry-and-custom-domain.html" rel="nofollow">http://programming.mvergel.com/2011/11/cloud-foundry-and-custom-domain.html</a> ), that can be accessed by users, using lets say myapp.appspot.com    </p>
  
  <p>Now, my question is: is there an elegant way of preventing users from accessing my app using the link myapp.cloudfoundry.com and allow them to just use myapp.appspot.com ?
     I am thinking of adding some sort of token in the request headers when redirecting from appspot to cloudfoundry, but I don't think this is the best solution. </p>
  
  <p>Can some one give me a hint about this one ?</p>