title: How to configure nginx's default.conf
body: <p>I'm trying to configure <code>default.conf</code> in <code>/etc/nginx/conf.d</code> to show a simple landing page located at <code>/home/ubuntu/project-source/company/entry/index.html</code>.</p>
  
  <p>The domains are set up correctly as far as I know to point to the server </p>
  
  <pre><code>A: test24.company.io -&gt; &lt;aws-elastic-IP&gt;
  </code></pre>
  
  <p><strong>default.conf:</strong></p>
  
  <pre><code>server {
      listen       80;
      server_name  localhost;
  
      index index.html;
  
      location / {
          root   /home/ubuntu/project-source/company/entry;
      }
  }
  
  server {
      server_name test24.company.io www.test24.company.io;
  
      listen 443 ssl; # managed by Certbot
      ssl_certificate /etc/letsencrypt/live/test24.company.io/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/test24.company.io/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
  }
  
  server {
      if ($host = test24.company.io) {
          return 301 https://$host$request_uri;
      } # managed by Certbot
  
  
      listen      80;
      server_name test24.company.io www.test24.company.io;
      return 404; # managed by Certbot
  }
  </code></pre>
  
  <p>Additional question: the project will run 2 processes on 2 subdomains lets say <code>sub1</code> and <code>sub2</code> and they will run on  <code>localhost:3001</code> and <code>localhost:3002</code> respectively, how do I configure <code>default.conf</code> to point/proxy to these processes as well? </p>