Create the SSL certificate -
Let us make a directory to store all our ssl configuration.
sudo mkdir /etc/nginx/ssl
Next, create the key -
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
These options will create both a key file and a certificate.