How to install SSL certificate on nginx?

This guide explains how to install an SSL certificate issued through ClouDNS on an Nginx web server. The instructions cover Actalis, RapidSSL, and Sectigo certificates, including the intermediate certificates required to serve a complete certificate chain.

Step 1: Download the SSL certificate and certificate chain

Download your SSL certificate from the ClouDNS web panel. The certificate file will typically be named:

your-domain.com.crt

Nginx must also serve the correct intermediate certificate chain. Select the Certificate Authority (CA) that issued your SSL certificate to view its download and installation instructions.

Before you begin

Check the Issuer of your domain certificate and use the corresponding CA section below. The required chain can vary even between certificates issued by the same provider.

Actalis certificates

For Actalis Domain Validated (DV) SSL certificates issued through the 2025 RSA hierarchy, download both the intermediate certificate and the cross-certificate from the official Actalis Legal Repository.

CertificateDownload
Actalis Domain Validated TLS Server RSA CA 2025
Intermediate certificate
Download from Actalis
Actalis Crosscert TLS RSA Root CA 2025
Cross-certificate
Download from Actalis

For the examples below, the two downloaded files are named:

actalis_dv_tls_rsa_2025.pem
actalis-crosscert-tls-rsa-2025-v3.crt
Important: These files apply to certificates issued by Actalis Domain Validated TLS Server RSA CA 2025. Certificates issued through another Actalis hierarchy, including ECC, OV or EV, may require different intermediate certificates.

The cross-certificate links Actalis TLS Server RSA Root CA 2025 to Actalis Authentication Root CA. It can provide an alternative trust path for systems that trust the older Actalis root.

Combine the three certificates in the following order:

OrderFilePurpose
1 your-domain.com.crt Domain certificate
2 actalis_dv_tls_rsa_2025.pem Intermediate CA
3 actalis-crosscert-tls-rsa-2025-v3.crt Cross-certificate

Linux:

(cat your-domain.com.crt; printf '\n'; cat actalis_dv_tls_rsa_2025.pem; printf '\n'; cat actalis-crosscert-tls-rsa-2025-v3.crt) > your-domain.com.fullchain.pem

Windows (Command Prompt):

(type your-domain.com.crt & echo. & type actalis_dv_tls_rsa_2025.pem & echo. & type actalis-crosscert-tls-rsa-2025-v3.crt) > your-domain.com.fullchain.pem
Note

Use the actual downloaded filenames if they differ from these examples. All certificates must be in PEM format, with each -----BEGIN CERTIFICATE----- block starting on a new line. A .crt file can also contain PEM-formatted text.

RapidSSL certificates

Open the DigiCert Trusted Root Authority Certificates page and locate the intermediate certificate corresponding to your RapidSSL certificate.

For certificates issued through RapidSSL TLS RSA CA G1, download the matching intermediate certificate in PEM format. In the examples below, its filename is:

RapidSSL-TLS-RSA-CA-G1.pem
Important: Confirm that RapidSSL TLS RSA CA G1 is the correct issuer for your certificate. Other RapidSSL issuing hierarchies may require a different intermediate certificate.

Create the full certificate chain by placing your domain certificate first, followed by the intermediate certificate.

Linux:

(cat your-domain.com.crt; printf '\n'; cat RapidSSL-TLS-RSA-CA-G1.pem) > your-domain.com.fullchain.pem

Windows (Command Prompt):

(type your-domain.com.crt & echo. & type RapidSSL-TLS-RSA-CA-G1.pem) > your-domain.com.fullchain.pem
Sectigo certificates

Download the appropriate intermediate certificate or CA Bundle from the Sectigo Public Intermediates and Roots page.

For the examples below, the downloaded certificate chain is named:

sectigo-ca-bundle.pem
Important: The required Sectigo chain depends on the issuing CA. Make sure the intermediate certificate or CA Bundle matches the issuer of your SSL certificate.

Create the full certificate chain by placing the domain certificate first, followed by the intermediate certificate or CA Bundle in the correct order.

Linux:

(cat your-domain.com.crt; printf '\n'; cat sectigo-ca-bundle.pem) > your-domain.com.fullchain.pem

Windows (Command Prompt):

(type your-domain.com.crt & echo. & type sectigo-ca-bundle.pem) > your-domain.com.fullchain.pem

After creating your-domain.com.fullchain.pem for the appropriate CA, continue with Step 2.

Step 2: Create a directory for the SSL certificate files

Create a directory where Nginx will read the certificate files. For example:

sudo mkdir -p /etc/nginx/ssl/example_com/

Move the full certificate chain created in Step 1 into this directory:

sudo mv your-domain.com.fullchain.pem /etc/nginx/ssl/example_com/

Step 3: Store the private key

Move the private key generated when the Certificate Signing Request (CSR) was created to the same directory, or another secure location accessible to Nginx.

sudo mv example_com.key /etc/nginx/ssl/example_com/

Restrict access to the private key. On a typical Linux installation, you can set its ownership and permissions as follows:

sudo chown root:root /etc/nginx/ssl/example_com/example_com.key
sudo chmod 600 /etc/nginx/ssl/example_com/example_com.key
Security

The private key must match the domain certificate. Do not upload it to a public web directory or share it with unauthorized users. If Nginx runs under a nonstandard user account, make sure its master process can access the key.

Step 4: Configure Nginx

Open the Nginx configuration file for your website. Configure ssl_certificate to use the full certificate chain and ssl_certificate_key to use the corresponding private key.

Example HTTPS server block:

server {
    listen 443 ssl;
    server_name domainname.com;

    ssl_certificate /etc/nginx/ssl/example_com/your-domain.com.fullchain.pem;
    ssl_certificate_key /etc/nginx/ssl/example_com/example_com.key;

    ssl_protocols TLSv1.2 TLSv1.3;

    # Add your existing website configuration here.
}
Important

Use listen 443 ssl; rather than the old ssl on; directive. The ssl on; directive was removed from recent Nginx releases.

If you use a Multi-Domain or Wildcard SSL certificate, configure the appropriate server_name values and HTTPS server blocks. The same certificate and private key can be referenced by multiple server blocks when the certificate covers their hostnames.

The Nginx configuration location depends on your operating system and installation. Common locations include:

LocationPurpose
/etc/nginx/nginx.conf Main Nginx configuration
/etc/nginx/conf.d/ Additional configuration files
/etc/nginx/sites-available/ Virtual host configurations on some distributions
/etc/nginx/sites-enabled/ Enabled virtual host configurations on some distributions

Step 5: Optional - Enable OCSP Stapling

Nginx supports OCSP Stapling, which lets the server include a recent OCSP response in the TLS handshake. This feature is optional and requires the issuing CA to provide a usable OCSP responder.

To enable it, add these directives inside your HTTPS server block:

ssl_stapling on;
ssl_stapling_verify on;
resolver DNS_RESOLVER_IP;
ssl_trusted_certificate /etc/nginx/ssl/example_com/trusted-ca.pem;

Replace DNS_RESOLVER_IP with the IP address of a DNS resolver reachable from your server.

The file configured with ssl_trusted_certificate must contain the appropriate intermediate CA certificate(s) and trusted root certificate required to verify the OCSP response. It is a separate PEM trust file, not necessarily the same as the fullchain file.

Certificate chain vs. trusted CA file

ssl_certificate specifies the certificate chain sent to connecting clients. ssl_trusted_certificate specifies certificates trusted by Nginx for verification and is not sent to clients. You can omit the stapling directives entirely if you do not use OCSP Stapling.

For additional information, see the official Nginx SSL module documentation.

Step 6: Test the Nginx configuration

Before reloading Nginx, check the configuration for syntax and configuration errors:

sudo nginx -t

If the test reports that the configuration is successful, continue to the next step. Otherwise, fix the reported errors first.

Step 7: Reload Nginx

Apply the updated configuration without unnecessarily terminating active connections:

sudo systemctl reload nginx

If your system does not use systemd, use the appropriate service management command for your operating system.

Step 8: Verify the SSL certificate

Open your website using HTTPS and verify that the browser accepts the certificate and the correct hostname is covered.

You can also inspect the certificate chain served by Nginx from the command line:

openssl s_client -connect domainname.com:443 -servername domainname.com -showcerts

Confirm that the domain certificate is served first, followed by the correct intermediate certificate(s), and review the reported verification status. Replace domainname.com with your actual hostname.

Single SSL certificate on multiple servers

If your website is hosted on multiple web servers, you normally do not need to purchase a separate SSL certificate for each server. The same certificate and corresponding private key can be installed on multiple servers hosting names covered by that certificate.

Download the certificate from the ClouDNS web panel and obtain the matching Actalis, RapidSSL, or Sectigo certificate chain in Step 1. Securely copy the private key and complete certificate chain to each required server, then configure Nginx using the same instructions.

The private key must match the SSL certificate and should be transferred and stored securely.

For a Wildcard SSL certificate, ensure the wildcard hostname is included in the certificate. For example:

*.domain.com

Configuration file names and directory structures differ between operating systems and Nginx installations. Refer to your operating system and Nginx documentation to confirm which files should be modified.


Last modified: 2026-10-16
We value your privacy! We use cookies to enhance your browsing experience, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. Cookie Policy.