title: Why does CORS apply on localhost when using 'lvh.me'?
body: <p>I was having an issue with CORS in my Rails App and my JS front-end app, before I used rack-cors (<a href="https://github.com/cyu/rack-cors" rel="nofollow">https://github.com/cyu/rack-cors</a>).</p>
  
  <p>The JS front-end app will be a subdomain of my Rails app. So I should not be having this issue in production. However on local, I am running my front-end app on a server with:</p>
  
  <p><code>python -m SimpleHTTPServer</code></p>
  
  <p>I then access it via <code>http://dashboard.lvh.me:8000</code>. All calls are made to the backend rails app to <code>api.lvh.me:3000</code>.</p>
  
  <p>When doing requests without handling CORS, I get a CORS error. Why am I getting a CORS error when both are on the same subdomain (lvh.me)? This happened in all browsers.</p>
  
  <p>Why do I need to use rack-cors? Will this also happen in production? Right now, I am just running <code>rails s</code>. When using nginx, will this go away when both are on the same domain, but different subdomains?</p>