Installation configuration nginx windows certificates - kwantu/platformconfiguration GitHub Wiki

back

How to convert windows certificates to use with nginx

Here are some links to assist

  1. https://blog.knoldus.com/easiest-way-to-setup-ssl-on-nginx-using-pfx-files/
  2. https://blog.intelligentbee.com/2017/09/22/install-pxf-windows-ssl-certificate-linux-web-server/
  3. https://www.youtube.com/watch?v=RwZfDCDuyfg

Steps to follow

  1. We’ll start by extracting the CRT file using openssl with the following command
openssl pkcs12 -in ./YOUR-PFX-FILE.pfx -clcerts -nokeys -out domain.crt
  1. Followed by extracting the private key with the following command
openssl pkcs12 -in ./YOUR-PFX-FILE.pfx -nocerts -nodes -out domain.key
  1. Now we can proceed by setting up a most simple NGINX server using the following configurations
server {
 listen 443 ssl;
 server_name domain.com domain.com;
 ssl_certificate /path/to/your/CRT_file/domain.crt;
 ssl_certificate_key /path/to/your/RSA_file/domain.key;

 root /mnt/coming-soon/bushbeans;
 index index.html;
 include /etc/nginx/mime.types;
}

https://gist.github.com/mediaupstream/a2694859b1afa59f26be5e8f6fd4806a