title: Unable to configure Nginx correctly for Node.js app
body: <p>I am trying to install a react.js app and using <code>pm2</code> package for running the server.</p>
  
  <p>My <code>/etc/nginx/sites-available/default</code> file's contents are: </p>
  
  <pre><code>server {
      listen 80;
  
      server_name my.domain.name;
  
      location / {
          proxy_pass http://127.0.0.1:8080;
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection 'upgrade';
          proxy_set_header Host $host;
          proxy_cache_bypass $http_upgrade;
      }
  }
  </code></pre>
  
  <p>My react server is running on port 8080, since when I do <code>curl localhost:8080</code> from the server, I get the appropriate response. Also, with <code>curl localhost</code> also I get the correct react server's response.</p>
  
  <p>However, when I visit <code>my.domain.name</code> in the browser, I just get the default nginx page saying it's successfully installed.</p>
  
  <p>What am I missing here?</p>
  
  <p>Edit:</p>
  
  <p>Added Reactjs app's <code>server.js</code> file:</p>
  
  <pre><code>var webpack = require('webpack');
  var WebpackDevServer = require('webpack-dev-server');
  var config = require('./webpack.config');
  
  new WebpackDevServer(webpack(config), {
    publicPath: config.output.publicPath,
    hot: true,
    historyApiFallback: true
  }).listen(8080, 'localhost', function (err, result) {
    if (err) {
      return console.log(err);
    }
  </code></pre>
  
  <p>console.log('Listening at <a href="http://localhost:8080/" rel="nofollow">http://localhost:8080/</a>');
  });</p>