资料来源:网络整理
时间: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;
}
}

版权说明:
本网站凡注明“广州京杭 原创”的皆为本站原创文章,如需转载请注明出处!
本网转载皆注明出处,遵循行业规范,如发现作品内容版权或其它问题的,请与我们联系处理!
欢迎扫描右侧微信二维码与我们联系。