title: Cors Blocks Request with status 403 on Nginx
body: <p>I am facing a strange issue with running CORS on Nginx, CORS is working fine for everything but one scenario when the Server responds with a 403 http response.</p>
  
  <p>Basically when I login with correct credentials the cors request works fine , however when I provide wrong credentials for login the server(backend) responds with a 403 status and I get the following error
  <code>
  "NetworkError: 403 Forbidden - <a href="http://mydomain.com/v1/login" rel="nofollow">http://mydomain.com/v1/login</a>"
  login
  Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <a href="http://mydomain.com/v1/login" rel="nofollow">http://mydomain.com/v1/login</a>. This can be fixed by moving the resource to the same domain or enabling CORS.
  </code>
  If the credentials are correct I don't get this error and everything works perfectly.</p>
  
  <p>I have done the configuration for enabling CORS and it seems to be working fine for everything else.</p>
  
  <p>Following are the Request Headers</p>
  
  <p><strong>Request Headers</strong>
  <code>
      User-Agent:Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0
      Referer:<a href="http://abc.mydomain.com/" rel="nofollow">http://abc.mydomain.com/</a>
      Pragma: no-cache
      Origin: <a href="http://abc.mydomain.com" rel="nofollow">http://abc.mydomain.com</a>
      Host:   www.mydomain.com
      Content-Type:   application/json;charset=utf-8
      Content-Length: 74
      Connection: keep-alive
      Cache-Control:  no-cache
      Accept-Language:    en-US,en;q=0.5
      Accept-Encoding:    gzip, deflate
      Accept: application/json, text/plain, <em>/</em>
  </code>
  <strong>Response Headers</strong>
  <code>
      Server: nginx/1.4.1
      Date:   Tue, 10 Jun 2014 05:28:30 GMT
      Content-Type:   application/json; charset=utf-8
      Content-Length: 76
      Connection: keep-alive
  </code></p>