Skip to content

Instantly share code, notes, and snippets.

@nanusdad
Created March 14, 2024 09:05
Show Gist options
  • Save nanusdad/07c6650b8faf6abb4c045ca61145521e to your computer and use it in GitHub Desktop.
Save nanusdad/07c6650b8faf6abb4c045ca61145521e to your computer and use it in GitHub Desktop.
Setting up SSL cert with nginx

Setting up SSL cert with nginx

  1. Copy the .crt file and encrypted .key file to nginx server
  2. Decrypt the .key file
openssl rsa -in encrypted.key -out decrypted.key
  1. Concatenate the .crt and and encrypted .key file
cat domain.crt encrypted.key > domain.pem
  1. Update nginx config file and add the following lines
 ssl_certificate /etc/ssl_certs/domain.pem;
 ssl_certificate_key /etc/ssl_certs/decrypted.key;
  1. Check nginx config
nginx -t
  1. Reload nginx
systemctl reload nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment