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