美文网首页
Nginx搭建https

Nginx搭建https

作者: 杨肆月 | 来源:发表于2019-04-11 17:16 被阅读0次

    参考:
    https://juejin.im/post/590ec765a22b9d0058fcfaa5
    https://www.cnblogs.com/yjmyzz/p/openssl-tutorial.html

    键入命令:

    cd /usr/local/nginx/conf
    //下面要填密码和一堆信息
    openssl genrsa -des3 -out server.key 1024
    openssl req -new -key server.key -out server.csr
    openssl req -new -x509 -key server.key -out ca.crt -days 3650
    

    在nginx配置文件里配置:

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

    重启nginx生效

    相关文章

      网友评论

          本文标题:Nginx搭建https

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