1. Import your SSL to the server through FTP and unzip them in a particular directory, If you don’t have SSL you can generate Let’s Encrypt free SSL by following the below steps.
install the git package:
Debian/Ubuntu
sudo apt-get install git
RedHat/Centos
sudo yum install git
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
Navigate to the clone directory
sudo cd /opt/letsencrypt
sudo -H ./letsencrypt-auto certonly --standalone -d cyberbuddy.in -d www.cyberbuddy.in
IMPORTANT NOTES:
– Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/cyberbuddy.in/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/cyberbuddy.in/privkey.pem
Your cert will expire on 2020-11-08. To obtain a new or tweaked
version of this certificate in the future, simply run
letsencrypt-auto again. To non-interactively renew *all* of your
certificates, run “letsencrypt-auto renew”
– If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let’s Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
2. Enable SSL Module
sudo a2enmod ssl
3. Create Virtual Host For SSL
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
server_name cyberbuddy.com;
root /var/www/cyberbuddy.com/public_html;
index index.html;
ssl on;
ssl_certificate /etc/nginx/ssl-certs/nginx.crt;
ssl_trusted_certificate /etc/nginx/ssl-certs/nginx.crt;
ssl_certificate_key /etc/nginx/ssl-certs/nginx.key;
location / {
try_files $uri $uri/ =404;
}
}
4. Restart the nginx service and Enjoy
sudo service nginx restart
Using the above tutorial you have learned How To Configure SSL on Nginx.
Recent Posts
- HOW TO CREATE A SINGLE IAM USER TO ACCESS ONLY SPECIFIC S3 BUCKET OF FOLDER
- HOW To SAVE OUR CLIENTS MONEY BY AUTOMATING THE START AND STOP OF EC2 INSTANCES ON AWS BY USING LAMBDA
- Share your S3 bucket with another account
- How to disable directory listing and restrict files/directory in Apache
- How To Handle Multiple PHP Versions With Apache WebServer On Centos 7/8
joker
There is significantly a bundle to understand about this. I think you made certain great factors in functions likewise. Eirena Mart Wilbur
Lesli
It’s truly a great and helpful piece of information. I am happy that you shared
this useful information with us. Please keep us informed like this.
Thanks for sharing.