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
Other NGINX blogs you might find useful
- NGINX – Load Balancing your application made simple
- NGINX – Redirecting traffic between www and non-www domain
- NGINX – Redirecting HTTP to HTTPS
- NGINX – Restrict access to Geographical Locations using GeoIP module
- NGINX – Disable direct access (via http and https) to a website using IP address
- NGINX – Understanding and Setting up a reverse proxy server
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; }
Voila! All done.
Thanks! Your article helped for quick setup 🙂
Glad it helped! 🙂
Really very good article. Thank you so much.
Glad you liked it 🙂