一、HTTPS解析
https 加密
私钥
公钥
http 的握手 是确认网络是连通的。
https 的握手 是一个加密的过程 加密图
二、 使用Nginx 部署HTTPS 服务
1.证书生成命令(https://gist.github.com/Jokcy/5e73fd6b2a9b21c142ba2b1995150808) copy 里面的命令 在 Git上面运行
2.配置 Nginx 代码:
proxy_cache_path cache levels=1:2 keys_zone=my_cache:10m;# 把http变为 httpsserver { ?listen ??????80 default_server; ?# listen ??????[::]:80 default_server; ?server_name ?test.com; ?# return 302 https://$server_name$request_uri;}server { ?listen ??????443; ?server_name ?test.com;#开启https验证 ?ssl on; ?ssl_certificate_key ?../certs/localhost-privkey.pem; ?ssl_certificate ?????../certs/localhost-cert.pem; ?location / { ???proxy_cache my_cache; ???proxy_pass http://127.0.0.1:8888; ???proxy_set_header Host $host; ?}}
Nginx 代理以及HTTPS (二)
原文地址:https://www.cnblogs.com/zhangtaotqy/p/9452047.html