Installation instructions for Nginx Server

Apr 20, 2023
The steps outlined below will assist you in installing an SSL certificate on NGINX SERVER. It is important to note that if you have multiple servers or devices, the certificate must be installed on each one that requires security.

If you have not yet generated your certificate and finished the validation process, refer to our CSR Generation Instructions before proceeding with the instructions below.


Step 1: Obtain an SSL certificate
  1. Obtain an SSL certificate from a trusted certificate authority (CA) such as DigiCert, GlobalSign, or Comodo.
Step 2: Generate a strong Diffie-Hellman group
  1. SSH into the server and navigate to the Nginx directory: cd /etc/nginx
  2. Generate a strong Diffie-Hellman group: openssl dhparam -out dhparam.pem 2048
Step 3: Create a new SSL directory and copy the certificate files
  1. Create a new directory for the SSL certificate and key files: mkdir /etc/nginx/ssl
  2. Copy the SSL certificate and key files to the new directory: cp cert.crt key.key /etc/nginx/ssl/
Step 4: Update the Nginx configuration
  1. Open the Nginx configuration file: nano /etc/nginx/nginx.conf
  2. Add the following to the server block:
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/cert.crt;
ssl_certificate_key /etc/nginx/ssl/key.key;
ssl_dhparam /etc/nginx/dhparam.pem;
Step 5: Enable SSL on the virtual host
  1. Open the virtual host configuration file: nano /etc/nginx/sites-available/default
  2. Update the server block to redirect all incoming HTTP traffic to HTTPS:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
Step 6: Test the SSL configuration
  1. Test the Nginx configuration: nginx -t
  2. If the test is successful, restart Nginx to apply the changes: service nginx restart
  3. Verify the SSL certificate is installed correctly by visiting the website through https:// and checking that it display the padlock icon, and that the certificate is issued by a trusted CA.

Have any Questions


If you have any questions, feel free to call us