Skip to content

Instantly share code, notes, and snippets.

@kieetnvt
Created September 11, 2018 01:44
Show Gist options
  • Save kieetnvt/8436300827363d79830e994297d1b2db to your computer and use it in GitHub Desktop.
Save kieetnvt/8436300827363d79830e994297d1b2db to your computer and use it in GitHub Desktop.
Install SSL Namecheap for NGINX server

Install SSL Namecheap for NGINX server

In case of Comodo certificates

  1. receive the zip archive with *.crt and *.ca-bundle files then extract it
  2. you will receive files:
    • youdomainname.crt
    • youdomainname.ca-bundle
  3. NGINX need all the certificates. You should combine theses 2 files. The *.crt should be list first, followed by (theo sau) the chain of CA certificates *.ca-bundle
  4. CMD combine: $ cat yourdomainname.crt yourdomainname.ca-bundle >> cert_chain.crt
  5. Edit your nginx configure file like this one:
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/cert_chain.crt;
ssl_certificate_key /etc/ssl/yourdomainnamekey.key;
}
  1. But from NGINX version 1.15.0 your nginx configure change like this one:
server {
listen 443 ssl;
ssl_certificate /etc/ssl/cert_chain.crt;
ssl_certificate_key /etc/ssl/yourdomainnamekey.key;
  1. Starting from Nginx 1.15.0 it is also possible to set up a single HTTP/HTTPS server:
server {

listen 80;
listen 443 ssl;
ssl_certificate /etc/ssl/cert_chain.crt;
ssl_certificate_key /etc/ssl/yourdomainnamekey.key;

  1. Reload & Restart NGINX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment