03_Nginx支持SSL
2024-10-20 11:49:33
1、申请证书
https://freessl.cn/
2、创建证书
3、离线生产
4、下载Keymanager
https://keymanager.org/
5、打开生产密钥
6、DNS验证
进入域名管理控制台,选择txt解析
7、检测解析
解析要等一会,基本没问题
8、上传密钥
9、nginx配置
server {
listen 80;
server_name dianjiu.co www.dianjiu.co;
rewrite ^(.*)$ https://$host$1 permanent; #所有的http请求,全部重定向到https中。
}
server {
listen 443 ssl
server_name dianjiu.co www.dianjiu.co;
ssl_certificate /app/ssl/dianjiu_co/dianjiu_co.crt;
ssl_certificate_key /app/ssl/dianjiu_co/dianjiu_co.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照这个套件配
ssl_prefer_server_ciphers on;
location / {
root /app/web/dianjiu_co; #前端服务
index index.html index.htm;
}
location /api {
## 重写,转发前,将url中的某些参数进行过滤
rewrite ^/api/(.*)$ /$1 break;
## 代理转发地址,具体的 host 和 post 自己指定
proxy_pass http://47.11.59.245:18181;
}
}
10、验证https
访问 https://dianjiu.co/
最新文章
- .Net mvc 根据前台参数动态绑定对象
- 开源镜像源(转自[tanghuimin0713的博客])
- Linux下的tar压缩解压缩命令详解
- [javaSE] 注解-JDK中的注解
- plain framework 1 参考手册 入门指引之 简明教程
- JS 保留两位小数问题收集
- Working with HTTP
- vue.js 2.0开发
- 变形--旋转 rotate()
- XAF应用开发教程(七)外观控制模块
- 如何在低api中使用View的属性设置方法如setAlpha等
- String 去重,区分大小写
- Elasticsearch 搜索不到数据问题(_mapping 设置)
- java中把字节数组转换为16进制字符串
- Linux系统编程——进程调度浅析
- 网上下载的“上下3D”和“左右3D”影片该如何播放?
- 整理php操作memcache缓存为基础的方法
- 花括号中的json数据--->;转为数组array
- Infix to postfix conversion 中缀表达式转换为后缀表达式
- tomcat线程初探