Nginx/SSssl

来自OSSmedia
Brucekomike讨论 | 贡献2024年12月2日 (一) 09:58的版本 (创建页面,内容为“本页面介绍如何创建自签名证书 sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt sudo nano /etc/nginx/snippets/self-signed.conf add these line ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt; ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key; 然后就可以在nginx配置文件里面添加此行了 include snippets/self-signed.conf;”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

本页面介绍如何创建自签名证书

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
sudo nano /etc/nginx/snippets/self-signed.conf

add these line

ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;

然后就可以在nginx配置文件里面添加此行了

include snippets/self-signed.conf;