1,进入腾讯云控制台搜索ssl关键字
2,点击申请免费证书
image.png image.png填写完成之后即可审核,一个小时内即可审核通过
下载文件到本地
image.png我的云服务器是nginx系统
将nginx里面的文件放在云服务某个文件夹下, 我放在/etc/nginx/下
我的配置文件nginx配置文件是 /etc/nginx/conf.d/docker.conf
vim docker.conf
image.png
server {
listen 80;
server_name www.webrabbit.club;
root /var/www/html;
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl_certificate "/etc/nginx/1_www.webrabbit.club_bundle.crt";
ssl_certificate_key "/etc/nginx/2_www.webrabbit.club.key";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root /var/www/html; //前端目录
index index.html index.htm;
}
location /api/ {
proxy_pass http://云服务器ip:7001/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
保存推出 :wq!
重启nginx
nginx -s reload
image.png
网友评论