Loading

Windows下Nginx配置SSL实现Https访问(包含证书生成)

Windows下Nginx配置SSL实现Https访问(包含证书生成)

学习了:https://www.cnblogs.com/developer-ios/p/6074665.html

在执行openssl req -new -key lee.key -out lee.csr 命令的时候,需要指定openssl.conf文件位置;

openssl req -new -key lee.key -config "D:\AMD64-Win64OpenSSL-0_9_8g\openssl.conf" -out lee.csr

此处学习了:https://blog.csdn.net/liangpei2008/article/details/7303018

https://www.cnblogs.com/amboyna/archive/2008/08/30/1280127.html

在启动nginx的时候,需要把lee.key和lee.crt拷贝到conf目录下面,nginx.conf文件修改为:

此处学习了:https://blog.csdn.net/lovetina2017/article/details/78213268

    server {
        listen       443 ssl;
        server_name  www.stono.com;

        ssl_certificate      lee.crt;
        ssl_certificate_key  lee.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {
            root   html;
            index  index.html index.htm;
        }
    }

 或者修改文件的目录为反斜线也是可以的;

    server {
        listen       443 ssl;
        server_name  www.stono.com;

        ssl_certificate      D:/nginx-1.12.2/ssl/lee.crt;
        ssl_certificate_key  D:/nginx-1.12.2/ssl/lee.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {
            root   html;
            index  index.html index.htm;
        }
    }

 

posted @ 2018-03-27 09:45  stono  阅读(344)  评论(0编辑  收藏  举报