title: nginx serving default page instead of serving a express API via reverse proxy
body: <p>I have been following this <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-20-04" rel="nofollow noreferrer">digitalocean</a> tutorial.</p>
  <p>I have a simple express server setup and running at port 3333:</p>
  <pre><code>const http = require('http');
  
  const hostname = 'localhost';
  const port = 3333;
  
  const server = http.createServer((req, res) =&gt; {
    res.statusCode = 200;
    res.setHeader('Content-Type', 'text/plain');
    res.end('Hello World!\n');
  });
  
  server.listen(port, hostname, () =&gt; {
    console.log(`Server running at http://${hostname}:${port}/`);
  });
  </code></pre>
  <p>pm2 shows the process as online and running, nothing is shown in the logs. However, when I access the site in the web browser I get the default nginx server page: <a href="https://image-parser.shooshte.com/" rel="nofollow noreferrer">https://image-parser.shooshte.com/</a> . I was expecting to get the default API response here. I am also unable to ping the server using postman.</p>
  <p>This is my nginx <code>/etc/nginx/sites-available/image-parser</code> config file:</p>
  <pre><code>server {
          listen 80;
          listen [::]:80;
  
          root /var/www/image-parser/html;
          index index.html index.htm index.nginx-debian.html;
  
          server_name image-parser www.image-parser.shooshte.com;
  
          location / {
              proxy_pass https://localhost:3333;
              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;
          }
  
      listen [::]:443 ssl; # managed by Certbot
      listen 443 ssl; # managed by Certbot
      ssl_certificate /etc/letsencrypt/live/image-parser.shooshte.com/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/image-parser.shooshte.com/privkey.pem; # managed by Certbot
      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  }
  </code></pre>
  <p>What am I missing?</p>