title: Nginx - Redirect domain to localhost:port content
body: <p>I installed Nginx on my server (my server uses WHM). And on this server has two accounts. Each account will run a server a NextJS site and each account has its own domain.</p>
  <p><strong>Site1</strong> will run on port 3000</p>
  <p><strong>Site2</strong> will run on port 3004</p>
  <p>What I want to do is:</p>
  <p>I want to access <strong>domain1</strong> I see the content of my <strong>site1</strong> in NextJS that runs on <strong>localhost:3000</strong></p>
  <p>And when I access <strong>domain2</strong> I see the content of my <strong>site2</strong> on NextJS running on <strong>localhost:3004</strong></p>
  <p>I tried to do a Nginx implementation for <strong>site1</strong>. But when I accessed it I saw a Cpanel screen, and the url was <strong>dominio1/cgi-sys/defaultwebpage.cgi</strong></p>
  <p>Here's the Nginx implementation I tried to do:</p>
  <pre><code>server {
      listen 80;
  
      server_name computadorsolidario.tec.br www.computadorsolidario.tec.br ;
  
      location / {
          proxy_pass http://localhost:3004;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection 'upgrade';
          proxy_set_header Host $host;
      }
  }
  </code></pre>
  <p>So how do I do this setting for nginx to have this behavior? And I'm changing the correct file?</p>
  <p><em>Note: I created the configuration file in <strong>/etc/nginx/conf.d/users/domain1/domio1.conf</strong> And within <strong>/etc/nginx/conf.d/users</strong> have several configuration files with the name of the accounts you have on the server. (They are already implemented.)</em></p>