Skip to content

Instantly share code, notes, and snippets.

@dharma017
Last active August 20, 2024 08:53
Show Gist options
  • Save dharma017/3230e6f3f017f482fe6adcd0b36a4c41 to your computer and use it in GitHub Desktop.
Save dharma017/3230e6f3f017f482fe6adcd0b36a4c41 to your computer and use it in GitHub Desktop.
Install Comodo SSL

Generate private key and csr file

openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr

server.key: it is the private key used on the TLS protocol.
server.csr: it is the required certificate signing request.

If all three certificates are listed separately, use the command:

cat your_domain.crt intermediate.crt root.crt >> ssl-bundle.crt

If the intermediate certificates are in one bundle, run:

cat your_domain.crt your_domain.ca-bundle >> ssl-bundle.crt

Make sure you save the ssl-bundle.crt file in the etc/ssl directory.

For Comodo SSL

cat SectigoRSAOrganizationValidationSecureServerCA.crt USERTrustRSAAAACA.crt AAACertificateServices.crt > your_domain.ca-bundle

To Update new SSL certificate in AWS Certificate Manager

Certificate body: STAR_your_domain.crt
Certificate private key: server.key
Certificate chain: your_domain.ca-bundle
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/ssl-bundle.crt;
ssl_certificate_key /path/to/your_private.key;
root /path/to/webroot;
server_name your_domain.com;
access_log /var/log/nginx/nginx.vhost.access.log;
error_log /var/log/nginx/nginx.vhost.error.log;
location / {
root /var/www/;
root /home/www/public_html/your.domain.com/public/;
index index.html;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment