Ubuntu 12.04 Node.js (Angular/Express app) Droplet doesn't pass OPTIONS method request

March 5, 2015 652 views
Node.js Nginx Ubuntu

I'm always getting an OPTIONS net::ERRCONNECTIONREFUSED error when I try to POST a form. In the beginning I thought it was nginx, but I tried redirecting port 80 to port 3000 (where my server is running) and I still get the same error. So this is a CORS issue. The problem is that express doesn't even receive the request when it's an OPTIONS request. I've tried to use the cors node module and about every Stack Overflow answer about the subject.

Not sure what I should post in terms of code, since I can't figure out where the error comes from.

When I was using nginx I got the following error:

2015/03/05 05:45:15 [error] 6079#0: *1 connect() failed (111: Connection refused)
while connecting to upstream,
client: x.x.x.x,
server: thepalette.tk,
request: "GET /register HTTP/1.1",
upstream: "http://x.x.x.x:3000/register",
host: "thepalette.tk"

Be the first one to answer this question.