title: Change port for http to https -- Nginx
body: <p>Sorry for limited understanding on Nginx, Iam new to Nginx.
  I have a webapp running on React and Nginx. Recently I received the SSL certificates for my website. I tried to configure the website and it worked partially. The problem is when I tried to open &quot;https://example.com&quot;, the SSL certificates are visible here but its showing nginx default home page. While when I open &quot;http://example.com&quot; it shows all the webcontent.</p>
  <p>I attempted to:</p>
  <ol>
  <li>change the port from 80 to 443</li>
  <li>Reinstall nginx.
  But nothing seems to work. Here is my nginx confs at the moment:</li>
  </ol>
  <p>/etc/nginx/sites-available/example.org</p>
  <pre><code>server {
      listen 443;
      listen [::]:443;
      
      ssl on;
      ssl_certificate /etc/nginx/ssl/bundle.cer;
      ssl_certificate_key /etc/nginx/ssl/example.key
      
      root /var/www/html;
      
      server_name example.org;
      
      location / {
          try_files $uri $uri/ =404;
      }
  }
  
  server {
          listen 80;
          listen [::]:80;
          
          server_name _;
          return 301 https://example.org;
  }
  </code></pre>
  <p>/etc/nginx/conf.d/www/example.org.conf</p>
  <pre><code>server {
      listen 80 default_server;
      server www.example.org;
      
      location / {
          root /usr/share/nginx/html;
          index index.htm; index.html;
      }
  }
  </code></pre>
  <p><strong>Note:</strong> I reload nginx at every new attempt.
  Please help where am I going wrong.</p>