title: Nginx - Even after adding the directive 'access control allow origin' the request logs error
body: <p>I am trying to run nginx infront of my nodejs application (I am using windows machine)</p>
  
  <p>My NodeJS Application is running in 3000 port</p>
  
  <p>I have started the Nginx at 8070 port</p>
  
  <p>When i try to hit <a href="http://localhost:8070/" rel="nofollow noreferrer">http://localhost:8070/</a> from browser am getting the issue quoted below</p>
  
  <p>This is my Nginx configuration</p>
  
  <pre><code>server {
      listen       8070;
      server_name  localhost;
  
  location / {
      access_log   logs/access.log;
      add_header 'Access-Control-Allow-Origin' '*' always;
      add_header 'Access-Control-Allow-Credentials' 'true';
      add_header 'Access-Control-Allow-Headers' 'Content-Type,Accept';
      add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
  
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_set_header X-NginX-Proxy true;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_max_temp_file_size 0;
      proxy_pass http://my-app/;
      proxy_redirect off;
      proxy_read_timeout 240s;
      }
      }
  </code></pre>
  
  <p>But still i am getting the following error</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="http://localhost:3000/my-app/api/engineOptions/get" rel="nofollow noreferrer">http://localhost:3000/my-app/api/engineOptions/get</a>. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:8070" rel="nofollow noreferrer">http://localhost:8070</a>' is therefore not allowed access.</p>
  </blockquote>
  
  <p>Am i missing anything in the nginx configuration regarding Access-Control-Allow-Origin directive?</p>