CONTACTUS
Live Chat
Chat now with us
Email Us
Send us an email, and we'll get back to you soon
Call Us
Reach out to us now

  Home > Knowledge Base >  User Guide >  How to install SSL certificates on an Nginx server

How to install SSL certificates on an Nginx server

2025-05-23

1. Prepare Certificate Files
Combine your certificate file and intermediate certificate into a single XXX.crt file, and ensure you have the corresponding XXX.key file.

2. Upload Files to the Server
Upload both the combined certificate file (XXX.crt) and the private key file (XXX.key) to your server.
Recommended: Place them in the /etc/nginx/cert/ directory.

3. Modify the Nginx Configuration
Edit the Nginx configuration file (typically located at /etc/nginx/nginx.conf or in the /etc/nginx/sites-enabled/ directory):

# The following SSL-related properties are critical for certificate configuration. Adjust other settings as needed.

server {

    listen 443 ssl;

    server_name localhost;  

    

    ssl_certificate cert/domain_name.crt;  

    ssl_certificate_key cert/domain_name.key;  

    

    ssl_session_timeout 5m;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;  

    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;  

    ssl_prefer_server_ciphers on;

    

    root /usr/share/nginx/html;  

    index index.html index.htm;

    

    location / {

        try_files $uri $uri/ =404;

    }

}

4. Save and Exit
Save the configuration file and exit the editor.

5. Restart Nginx
Apply the changes by restarting Nginx:

systemctl restart nginx


If you find 【How to install SSL certificates on an Nginx server】 useful, please share it with your friends. Thank you!

Copy link