Self-signed SSL certificate for nginx

2021.09.16  |  68

Create Self Signed SSL Certificate and Install it in Nginx Web Server

apt install openssl
mkdir /etc/nginx/ssl
cd /etc/nginx/ssl
sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout self.key -out self.crt
Add to the config we need in nginx:

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