In Nginx webserver will the files in NGINX folder be used. Upload the 2 files into /etc/ssl/

  1. Start by specifying the server should listen to port 443: listen 443 ssl;
  2. Make sure the server block includes the line: ssl on;
  3. Define the path of the Certificate: ssl_certificate /etc/ssl/domain.pem;
  4. Define the path of the Key: ssl_certificate_key /etc/ssl/domain.key;
  5. For reference, the SSL part of your configuration file should look similar like below:
    listen 443 ssl;
    ssl on;
    ssl_certificate /etc/ssl/domain.pem;
    ssl_certificate_key /etc/ssl/domain.key;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!AESGCM; ssl_prefer_server_ciphers on;
  6. You can add the following code if you want to force http to https:
    if ($scheme != "https") {
    rewrite ^ https://$host$uri permanent;
    }
  7. Restart NGINX: #systemctl restart nginx
Was this answer helpful? 507 Users Found This Useful (566 Votes)