Why does my http://localhost CORS origin not work?

I am stuck with this CORS problem, even though I set the server (nginx/node.js) with the appropriate headers. I can see in Chrome Network pane -> Response Headers: Access-Control-Allow-Origin:http://localhost which should do the trick. Here’s the code that I now use to test: var xhr = new XMLHttpRequest(); xhr.onload = function() { console.log(‘xhr loaded’); }; … Read more