Nginx下配置SSL安全协议

生成证书:

# 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; 
}

  重启nginx

 完成了。但这样证书是不被信任的

posted @ 2015-05-11 16:02  芭菲雨  阅读(298)  评论(0编辑  收藏  举报