How to Install Self-Signed SSL Certificate on Nginx Web Server in Ubuntu 22.04 LTS Server – 2023



How to Install Self-Signed SSL Certificate on Nginx Web Server in Ubuntu 22.04 LTS Server – 2023

How to Install Self-Signed SSL Certificate on Nginx Web Server in Ubuntu 22.04 LTS Server - 2023

In this video, I’m going to show you how you can create a self-signed SSL certificate and use it on Nginx.

PLEASE SUBSCRIBE 🙂
PLEASE HIT LIKE IF IT HELPED 🙂

I’m using Ubuntu 22.04 LTS server for this video, but if you’re using a different Linux distribution, you can follow along as the syntax and commands are nearly identical.

Self-signed certificates are useful for local development where you want to simulate an HTTPS environment. Take note that self-signed certificates are not meant for production, but they are ideal for localhost development.

GIVE SUPPORT – https://www.patreon.com/lazysysad
BUY ME A COFFEE – https://www.buymeacoffee.com/lazysysad
PAYPAL – https://www.paypal.com/donate/?hosted_button_id=K4RQ3LAWHGVS6

For you to be able to follow this video, you will need. An Nginx web server installed on Ubuntu 22.04 LTS server. To set this up, check the links below and follow my videos.

LINKS:
How to Install Ubuntu 22.04 LTS Server on VirtualBox in Windows 10 in 15 MINUTES – https://youtu.be/tEfewxvysGk
How to Install NGINX Web Server on Ubuntu 22.04 LTS Desktop – Linux in 1 MINUTE (NO TALK) – https://youtu.be/iJTscrYM6Eo

STEPS:
ssl-info.txt
[req]
default_bits = 2048
prompt = no
default_keyfile = localhost.key
distinguished_name = dn
req_extensions = req_ext
x509_extensions = v3_ca

[ dn ]
C = PH
ST = NCR
L = Manila
O = localhost
OU = Development
CN = localhost

[req_ext]
subjectAltName = @alt_names

[v3_ca]
subjectAltName = @alt_names

[alt_names]
DNS.1 = localhost
DNS.2 = 127.0.0.1

Commands:
cd /etc/nginx
sudo mkdir /etc/nginx/ssl
cd ssl
sudo vi ssl-info.txt
sudo openssl req -x509 -nodes -days 3652 -newkey rsa:2048 -keyout localhost.key -out localhost.crt -config ssl-info.txt
cd ../sites-available
cp default default.bak
sudo vi /etc/nginx/sites-available/default

listen 443 ssl http2;
listen [::]:443 ssl http2;

ssl_certificate /etc/nginx/ssl/localhost.crt;
ssl_certificate_key /etc/nginx/ssl/localhost.key;

ssl_protocols TLSv1.2 TLSv1.1 TLSv1;

sudo service nginx reload

Chapters:
00:00 Intro
00:46 SSH to Server
00:49 Create SSL Directory
01:18 Create SSL Information File
01:48 Execute OpenSSL Command
02:07 Modify Nginx Configuration
02:49 Reload Nginx
03:09 Open Browser
03:46 Outro

Please enjoy the video and if you have any questions, leave a comment down below.

Remember to Like, Share and Subscribe if you enjoyed the video!

#ubuntu
#nginx
#openssl
#thelazysysadmin