Nginx + https + 免费SSL证书配置指南
程序员文章站
2022-06-22 12:15:10
...
http://my.oschina.net/shootercn/blog/16712
生成证书:
编辑 nginx.conf
生成证书:
$ cd /usr/local/nginx/conf $ openssl genrsa -des3 -out server.key 1024 $ openssl req -new -key server.key -out server.csr $ cp server.key server.key.org $ openssl rsa -in server.key.org -out server.key $ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
编辑 nginx.conf
server { server_name YOUR_DOMAINNAME_HERE; listen 443; ssl on; ssl_certificate /usr/local/nginx/conf/server.crt; ssl_certificate_key /usr/local/nginx/conf/server.key; }
上一篇: 凉肝的比赛
下一篇: Bash脚本编程学习笔记08:函数