专业网站建设品牌,十四年专业建站经验,服务6000+客户--广州京杭网络
免费热线:400-683-0016      微信咨询  |  联系我们

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

当前位置:网站建设 > 技术支持
资料来源:网络整理       时间:2023/2/14 1:05:30       共计:3629 浏览
Windows下Nginx配置SSL实现Https访问(包含证书生成)

在执行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

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

    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;
        }
    }
版权说明:
本网站凡注明“广州京杭 原创”的皆为本站原创文章,如需转载请注明出处!
本网转载皆注明出处,遵循行业规范,如发现作品内容版权或其它问题的,请与我们联系处理!
欢迎扫描右侧微信二维码与我们联系。
·上一条:阿里云OSS服务-管理文件访问权限 | ·下一条:windows Nginx配置ssl安全证书

Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有    粤ICP备16019765号 

广州京杭网络科技有限公司 版权所有