Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

nginx install ssl certificate centos

Connect to your server via SSH.
Create a directory to store the server key, certificate, and intermediate bundle.
sudo mkdir /etc/nginx/ssl
Copy your private key which was created when you generated your CSR to the ssl folder
cp coolexample.key /etc/nginx/ssl
SFTP to your server, and upload your SSL certificate and intermediate bundle to the /etc/nginx/ssl folder.
Navigate to the SSL folder in SSH.
cd  /etc/nginx/ssl
Combine your SSL certificate and the intermediate bundle into one file using the concatenate command. Since your intermediate certificate and root certificate come in a bundle, you can use the following SSH command:
sudo cat f84e19a2f44c6386.crt gd_bundle-g2-g1.crt >> coolexample.crt

Note:The certificates have to be listed in this order with the concatenate command or the SSL will not work properly on your server.
Open your NGINX config file for the domain you're installing the SSL certificate to.
sudo vim /etc/nginx/sites-available/coolexample.com
Update the config file to use the SSL certificate.
server {
        listen 80;
        server_name coolexample.com;
        return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;

    server_name coolexample.com;
    ssl_certificate     /etc/nginx/ssl/coolexample.crt;
    ssl_certificate_key /etc/nginx/ssl/coolexample.key;

    root /usr/share/nginx/coolexample.com/;
    index index.php  index.html index.htm;

}
Save the config file.
wq!
Restart your NGINX server.
sudo service nginx restart
Comment

nginx install ssl certificate centos

Connect to your server via SSH.
Create a directory to store the server key, certificate, and intermediate bundle.
sudo mkdir /etc/nginx/ssl
Copy your private key which was created when you generated your CSR to the ssl folder
cp coolexample.key /etc/nginx/ssl
SFTP to your server, and upload your SSL certificate and intermediate bundle to the /etc/nginx/ssl folder.
Navigate to the SSL folder in SSH.
cd  /etc/nginx/ssl
Combine your SSL certificate and the intermediate bundle into one file using the concatenate command. Since your intermediate certificate and root certificate come in a bundle, you can use the following SSH command:
sudo cat f84e19a2f44c6386.crt gd_bundle-g2-g1.crt >> coolexample.crt

Note:The certificates have to be listed in this order with the concatenate command or the SSL will not work properly on your server.
Open your NGINX config file for the domain you're installing the SSL certificate to.
sudo vim /etc/nginx/sites-available/coolexample.com
Update the config file to use the SSL certificate.
server {
        listen 80;
        server_name coolexample.com;
        return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;

    server_name coolexample.com;
    ssl_certificate     /etc/nginx/ssl/coolexample.crt;
    ssl_certificate_key /etc/nginx/ssl/coolexample.key;

    root /usr/share/nginx/coolexample.com/;
    index index.php  index.html index.htm;

}
Save the config file.
wq!
Restart your NGINX server.
sudo service nginx restart
Comment

PREVIOUS NEXT
Code Example
Shell :: clear git bash window 
Shell :: how to fork a repo in git 
Shell :: git tag documentation 
Shell :: develop - FETCH_HEAD instead of origin develop 
Shell :: what to do with the git config 
Shell :: comment copier un fichier linux 
Shell :: openldap install centos 8 
Shell :: how to install face_recognition with conda 
Shell :: uninstall adobe creative cloud 
Shell :: scp command ubuntu 
Shell :: hide permission denied ~/.bash 
Shell :: merge master into feature branch 
Shell :: dokcer remove image 
Shell :: how to create a text file list of the contents of a folder and subfolders 
Shell :: how to turn off mac display 
Shell :: touch linux 
Shell :: jetbrains always add disable 
Shell :: mac force quit shortcut 
Shell :: how to move a file in bash 
Shell :: github how to add ssh key 
Shell :: how to install path adb 
Shell :: install carla for manjaro 
Shell :: cordova could not install from "android" as it does not contain a package.json file. 
Shell :: xrandr 1704x1000 
Shell :: ssh delete folders older than one year 
Shell :: E: Package ubuntu 
Shell :: Install Chef Habitat from the Command Line 
Shell :: Add branch to git prompt ubuntu wsl 
Shell :: If you do not have Xcode installed, download and install it from App Store and run it once to complete its setup 
Shell :: find directory spend inodes 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =