美文网首页
Nginx配置SSL

Nginx配置SSL

作者: bluexiii | 来源:发表于2016-11-22 14:41 被阅读21次

编译安装

下载全部源码
./configure --prefix=/path/to/nginx
--with-zlib=../zlib-1.2.8
--with-pcre=../pcre-8.39
--with-openssl=../openssl-1.1.0b
--with-http_ssl_module

生成证书

cd /usr/local/nginx/conf
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
openssl rsa -in server.key -out server_nopwd.key
openssl x509 -req -days 365 -in server.csr -signkey server_nopwd.key -out server.crt

配置nginx.conf

server {
listen 443;
ssl on;
ssl_certificate /usr/local/nginx/conf/server.crt;
ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key;
}

相关文章

网友评论

      本文标题:Nginx配置SSL

      本文链接:https://www.haomeiwen.com/subject/slgppttx.html