title: ssl with certbot and nginx on ubuntu
body: <p>I'm trying to add ssl to my website hosted on my VPS (Ubuntu 20). I do not have any skill nginx (v 1.18.0) and I just followed tutorials to add ssl to my website by helping letsEncrypt and certbot.</p>
  <p>Here I have some problems:</p>
  <ol>
  <li>I followed <a href="https://www.nginx.com/blog/using-free-ssltls-certificates-from-lets-encrypt-with-nginx" rel="nofollow noreferrer">this</a> tutorial and in it's 3rd part I only used <code>sudo certbot --nginx -d example.com</code> because I faced error in <code>sudo certbot --nginx -d www.example.com</code>. So I decided to just add example.com and forward every request from <strong><a href="http://www.appsazz.ir" rel="nofollow noreferrer">www.appsazz.ir</a></strong> to <strong>appsazz.ir</strong> in nginx. Now certbot generated a file inside <strong>/etc/nginx/conf.d</strong> with the name <strong>www.appsazz.ir.conf</strong>.It's configuration did't resolved my problem I tryed to changed it a little. Here is the file configurations:</li>
  </ol>
  <pre><code>server {
          if ($host = appsazz.ir){
                  return 301 https://$host$request_uri;
          }
          if ($scheme != &quot;https&quot;){
                  return 301 https://$host$request_uri;
          }
  }
  server {
  
      listen 80;
      listen [::]:80;
      root /var/www/venus;
      server_name  appsazz.ir www.appsazz.ir;
  
      # managed by Certbot
      listen 443 ssl default_server;
      ssl_certificate /etc/letsencrypt/live/appsazz.ir/fullchain.pem; #managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/appsazz.ir/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><code>nginx -t</code> response seems to be ok:</p>
  <blockquote>
  <p>nginx: the configuration file /etc/nginx/nginx.conf syntax is ok</p>
  </blockquote>
  <blockquote>
  <p>nginx: configuration file /etc/nginx/nginx.conf test is successful</p>
  </blockquote>
  <p>why when I request from browser to appsazz.ir it still loads with <strong>not secure?</strong></p>
  <ol start="2">
  <li>when I request on <a href="http://www.appsazz.ir" rel="nofollow noreferrer">www.appsazz.ir</a> Chrome responds with <strong>ERR_INTERNET_DISCONNECTED</strong> error</li>
  </ol>