From b2e2cfc29362e98bfaa6f4b3bbc6dc42477f99e0 Mon Sep 17 00:00:00 2001 From: Mehran Dehghanian Date: Wed, 22 Sep 2021 14:53:33 +0330 Subject: [PATCH] =?UTF-8?q?Add=20'NGINX=20=E2=80=93=20Easiest=20way=20to?= =?UTF-8?q?=20setup=20SSL=20using=20.pfx=20files'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...siest-way-to-setup-SSL-using-.pfx-files.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 NGINX-%E2%80%93-Easiest-way-to-setup-SSL-using-.pfx-files.md diff --git a/NGINX-%E2%80%93-Easiest-way-to-setup-SSL-using-.pfx-files.md b/NGINX-%E2%80%93-Easiest-way-to-setup-SSL-using-.pfx-files.md new file mode 100644 index 0000000..ff899c5 --- /dev/null +++ b/NGINX-%E2%80%93-Easiest-way-to-setup-SSL-using-.pfx-files.md @@ -0,0 +1,30 @@ +I’ll try to explain the easiest way to use a .pfx file that can be used to install SSL on NGINX. + +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 +``` + +Followed by extracting the private key with the following command + +``` +openssl pkcs12 -in ./YOUR-PFX-FILE.pfx -nocerts -nodes -out domain.rsa +``` + +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.rsa; + + root /mnt/coming-soon/bushbeans; + index index.html; + include /etc/nginx/mime.types; +} +``` + +[source](https://blog.knoldus.com/easiest-way-to-setup-ssl-on-nginx-using-pfx-files/) \ No newline at end of file