nginx支持https认证

工具下载地址:

链接:https://pan.baidu.com/s/11Nt0-P5VX-b2DoDQ7Wva-g 
提取码:ncgf 


1.jdk认证 (*keytool 是jdk自带工具)
keytool -genkey -v -alias tomcat -keyalg RSA -keystore d:\local.keystore -validity 36500


2.转换认证格式(* 下载工具.)
tomcat 支持:jks (.keystore)
nginx 支持:pem
命令:JKS2PFX.bat D:\local.keystore 123456 tomcat exportfile D:\\https_test


3.nginx exportfile.crt和exportfile.key 拷贝到conf下
4.修改配置文件,就可以访问了
server {
listen 443 ssl;
server_name localhost;

ssl_certificate exportfile.crt;
ssl_certificate_key exportfile.key;

ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root ..\dist;
#rewrite .* /index.html break;
#index index.html;
try_files $uri $uri/ /index.html;
}

}

  

posted @ 2020-11-18 10:22  SimpleSmile  阅读(314)  评论(0编辑  收藏  举报