How to install SSL certificate on nginx with PFX file on linux?

0

Let’s extract CRT file using OpenSSL command as follows:

openssl pkcs12 -in ./name-of-pfx-file.pfx -clcerts -nokeys -out any-domain.crt

Followed by extracting private key file using another OpenSSL command as follows:

openssl pkcs12 -in ./name-of-pfx-file.pfx -nocerts -nodes -out any-domain.rsa

Sample Server block to map generate CRT and private key files:

server {
 listen 443 ssl;
 server_name any-domain.com any-domain.com;
 ssl_certificate /path/to/your/CRT_file/domain.crt;
 ssl_certificate_key /path/to/your/RSA_file/domain.rsa;

 root /any-root;
 index index.html;
 include /etc/nginx/mime.types;
}

Leave a Comment

Skip to content