title: Subdomain problems using nginx as a reverse proxy for node apps
body: <p>I am new to nginx and I'm struggling to get my configuration for a reverse proxy working. I have a node app running on localhost:3010 and I'm trying to serve pages through nginx from this app at the subdomain dev.[sitename].org. Let's just say dev.example.org for readability. Here are the contents of a file I created in sites-available called example.org (is that the correct name for this file?):</p>
  
  <pre><code>server {
      server_name www.example.org example.org;
  }
  
  upstream app_dev.example.org {
      server 127.0.0.1:3010;
  }
  
  server {
      listen 0.0.0.0:80;
      server_name dev.example.org;
      access_log /var/log/nginx/dev.example.access.log;
      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://app_dev.example.org/;
              proxy_redirect off;
      }
  }
  </code></pre>
  
  <p>This is mostly based off this related question: <a href="https://stackoverflow.com/questions/5009324/node-js-nginx-and-now">Node.js + Nginx - What now?</a> however when I try to open dev.example.org in my browser, Chrome reports that it can't find the page. I can ping dev.example.org and get an IP address, so the server seems to be available, but my nginx configuration incorrect. I created the symlink in sites-enabled and restarted nginx, in case you thought I might have forgotten those steps. </p>
  
  <p>So my thought now is that I'm not referring to the subdomain correctly somewhere, or maybe my file in sites-available is named wrong. Any push in the right direction would be appreciated.</p>