1
sudo mkdir -p /etc/ssl/localhost
2chmod 777 /etc/ssl/localhost
3sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/localhost/key.key -out /etc/ssl/localhost/crt.crt
1
server {
2 listen 443 ssl;
3...
4 ssl_certificate /etc/ssl/localhost/crt.crt;
5 ssl_certificate_key /etc/ssl/localhost/key.key;
6...
7}