标签:ade serve wordpress 通讯 for 功能 ide pre forward
传输的数据可能会被第三方随时看到
a>
b> 对称加密算法 私钥 和 公钥 发送发
传输的数据不能随意让任何人进行修改
解决方式:
对称加密算法。公钥和私钥 保护好特征码
第一次通讯时,需要确认双方的身份正确
解决:非对称加密算法 私钥在服务器上保存好,公钥进行分发
公钥 ===证书(身份证)
CA证书颁发机构
实现HTTP向HTTPS跳转访问
cd /etc/nginx/ openssl genrsa -idea -out server.key 2048 genrsa --- 创建什么类型私钥 idea --- 需要给私钥文件设置密码 out --- 创建生成一个私钥文件 openssl req -days 36500 -x509 -sha256 -nodes -newkey rsa:2048 -keyout server.key -out server.crt req --- 创建一个证书文件 days --- 证书文件有效期(默认 天) x509 --- 证书文件格式 sha256 --- 指定生成证书算法 nodes --- 去除私钥的密码生成证书 keyout --- 指定加载私钥文件 out --- 生成的证书信息
ssl_certificate ssl_key/server.crt; ssl_certificate_key ssl_key/server.key; [root@web02 nginx]# cat /etc/nginx/conf.d/www.conf server { listen 443 ssl; server_name www.oldboy.com www.jd.com; root /html/www; index index.html; ssl_certificate server.crt; ssl_certificate_key server.key; }
server { listen 80; server_name www.oldboy.com; rewrite ^/(.*)$ https://$host/$1 redirect; } server { listen 443 ssl; server_name www.oldboy.com www.jd.com; root /html/www; index index.html; ssl_certificate server.crt; ssl_certificate_key server.key; }
用户客户端访问 --- lb01 --- web节点 www.oldboy.com http://www.oldboy.com https://www.oldboy.com ---> listen 443 ssl 第一个历程: 编写lb负载均衡配置文件 upstream oldboy { #server 10.0.0.7:443; server 10.0.0.8:443; #server 10.0.0.9:80; } server { listen 80; server_name localhost; rewrite ^/(.*)$ https://$host/$1 redirect; } server { listen 443 ssl; server_name localhost; ssl_certificate server.crt; ssl_certificate_key server.key; location / { proxy_pass https://oldboy; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } } 第二个历程: web节点配置 server { listen 443 ssl; server_name www.oldboy.com www.jd.com; root /html/www; index index.html; ssl_certificate server.crt; ssl_certificate_key server.key; }
用户客户端访问 --- lb01 ---> web节点 www.oldboy.com http://www.oldboy.com https://www.oldboy.com ---> listen 80 第一个历程: 负载均衡配置信息 upstream oldboy { #server 10.0.0.7:443; server 10.0.0.8:80; #server 10.0.0.9:80; } server { listen 80; server_name localhost; rewrite ^/(.*)$ https://$host/$1 redirect; } server { listen 443 ssl; server_name localhost; ssl_certificate server.crt; ssl_certificate_key server.key; location / { proxy_pass http://oldboy; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } } 第二个历程: web节点配置信息 server { listen 80; server_name www.oldboy.com www.jd.com; root /html/www; index index.html; }
第一个历程: 修改配置文件信息 修改负载均衡配置文件: upstream oldboy { #server 10.0.0.7:443; server 10.0.0.8:443; #server 10.0.0.9:80; } server { listen 80; server_name localhost; rewrite ^/(.*)$ https://$host/$1 redirect; } server { listen 443 ssl; server_name localhost; ssl_certificate server.crt; ssl_certificate_key server.key; location / { proxy_pass https://oldboy; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } } web服务器配置过程 server { listen 443 ssl; server_name blog.oldboy.com blog.oldgirl.com; ssl_certificate server.crt; ssl_certificate_key server.key; location / { root /html/blog; index index.php index.html; } location ~ \.php$ { root /html/blog; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS on; include fastcgi_params; } } 第二个历程: 修改wordpress后台信息 修改地址为 https://blog.oldboy.com 第三个历程: 重启nginx程序
标签:ade serve wordpress 通讯 for 功能 ide pre forward
原文地址:https://www.cnblogs.com/zhanghongqi/p/11896540.html