title: Connection refused on OPTIONS header in Node/Angular/Express App with nginx as reverse proxy
body: <p>I'm trying to get an express app running on a Digital Ocean Ubuntu 12.04 droplet with nginx as a reverse proxy, but I'm always getting an <strong>OPTIONS net::ERR_CONNECTION_REFUSED</strong> error when I try to POST a form. I've tried a bunch of different nginx configurations and cors settings and it still happens.</p>
  
  <p>Using Node v0.12, Express v4 and latest nginx.</p>
  
  <pre><code>server {
      listen 80;
      server_name thepalette.tk;
  
      location / {
          proxy_set_header X-Real-IP $remote_addr;
          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_pass http://127.0.0.1:3000;
          proxy_redirect off;
       }
  }
  </code></pre>
  
  <p>Edit:</p>
  
  <p>I've found the nginx error logs and it says the following:</p>
  
  <pre><code>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"
  </code></pre>