当前位置:网站首页>SSL certificate deployment
SSL certificate deployment
2022-07-07 03:32:00 【Not bald】
When we finish applying SSL After certificate , Also need to nginx Make the relevant configuration , Can be converted to a secure connection .
Download the certificate file to the server
- First , Go to the server console , Download to local certificate .
![image.png](https://img-blog.csdnimg.cn/img_convert/920be43a932d4224c7205550eec92239.png#clientId=ud0ca9c0e-c348-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=653&id=uf7b16ae7&margin=[object Object]&name=image.png&originHeight=653&originWidth=1755&originalType=binary&ratio=1&rotation=0&showTitle=false&size=77083&status=done&style=shadow&taskId=ub9c83b1f-921d-459b-93e1-ed300e0188d&title=&width=1755)
![image.png](https://img-blog.csdnimg.cn/img_convert/cadf3c7f55866c1f2511ce0ca546faae.png#clientId=ud0ca9c0e-c348-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=436&id=u68f60a67&margin=[object Object]&name=image.png&originHeight=808&originWidth=689&originalType=binary&ratio=1&rotation=0&showTitle=false&size=49967&status=done&style=shadow&taskId=u7d711b29-ea4a-4b4f-9597-1a61cd72c9f&title=&width=372)
After the above screenshot operation , We can download the certificate locally .
After decompression, as shown in the figure :
![image.png](https://img-blog.csdnimg.cn/img_convert/cddafa2a49e6928cfd21f872533eab18.png#clientId=ud0ca9c0e-c348-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=193&id=uc2957425&margin=[object Object]&name=image.png&originHeight=193&originWidth=631&originalType=binary&ratio=1&rotation=0&showTitle=false&size=14259&status=done&style=shadow&taskId=ue4942528-259b-4043-b01f-41c32823eec&title=&width=631)
among :.key
The end file is the key file ..pem
The end file is the certificate file .
We need to upload these two files to the server .
- Upload the local certificate to the specified directory of the server
I upload it here to /usr/local/nginx/cert/
Under the table of contents .
After uploading, see the figure :
![image.png](https://img-blog.csdnimg.cn/img_convert/c1dcda6f1918b76cd4cdfcf8725a8dc9.png#clientId=ud0ca9c0e-c348-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=38&id=u13b89c33&margin=[object Object]&name=image.png&originHeight=38&originWidth=341&originalType=binary&ratio=1&rotation=0&showTitle=false&size=3787&status=done&style=shadow&taskId=u7574af12-50b2-48ba-a9e7-9bfa40409a9&title=&width=341)
It contains our The key file
and Certificate file
Okay . So we upload the certificate to the server .
To configure nginx.conf
We also need to configure nginx.conf File to validate the certificate file .
add to server
modular .
Add modules to the configuration file server modular .
commonly , The default configuration file has these contents , It's just commented out . Let's just let go .
however , Also need to change something . The following tips have been given .
server {
listen 443 ssl;
server_name localhost;
# The following path is the absolute path of the file you uploaded in the previous step .
# If you don't write the absolute path, you will report an error
ssl_certificate /usr/local/nginx/cert/xxxxxxxx_bundle.pem;
ssl_certificate_key /usr/local/nginx/cert/xxxxxxxx.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
}
nginx add to ssl modular
- Check which modules we currently have installed
/usr/local/ngxin/sbin/nginx -V
Display information :
nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
configure arguments:
configure arguments
The module installed for us . You can see that it is not installed ssl modular .
If you contain ngx_http_ssl_module
, Then you can skip the step of adding modules .
- Get into nginx Installation directory
Be careful : No /usr/local/nginx/
My installation directory is :/usr/local/nginx-1.20.2
It contains configure
file .
![image.png](https://img-blog.csdnimg.cn/img_convert/3a67918ffa43dd65b6b4e5e2f9216ce2.png#clientId=ud0ca9c0e-c348-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=42&id=u3a556d7f&margin=[object Object]&name=image.png&originHeight=42&originWidth=822&originalType=binary&ratio=1&rotation=0&showTitle=false&size=9186&status=done&style=shadow&taskId=ucafb2ed0-6e93-4760-9814-966ec8dd558&title=&width=822)
Under the installation directory, enter :
./configure --prefix=/usr/local/nginx
./configure --with-http_ssl_module
make
make install
- Backup nginx. And then compile the nginx Replace the original nginx.
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
cp ./objs/nginx /usr/local/nginx/sbin/
restart nginx And test the
restart :
/usr/local/nginx/sbin/nginx -s reload
test :
Viewer input https:// domain name
![image.png](https://img-blog.csdnimg.cn/img_convert/1c13d92f4268580e8b54d1b5e1486784.png#clientId=ud0ca9c0e-c348-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=221&id=u63b81f78&margin=[object Object]&name=image.png&originHeight=221&originWidth=370&originalType=binary&ratio=1&rotation=0&showTitle=false&size=31819&status=done&style=shadow&taskId=u305a2b6c-8d6e-4477-aefa-38faefc4d96&title=&width=370)
The connection is secure , success .
边栏推荐
- 亚像素级角点检测Opencv-cornerSubPix
- DOMContentLoaded和window.onload
- SQL中删除数据
- Ubuntu20 installation redisjson record
- 如何替换模型的骨干网络(backbone)
- 我的勇敢对线之路--详细阐述,浏览器输入URL发生了什么
- Jericho is in non Bluetooth mode. Do not jump back to Bluetooth mode when connecting the mobile phone [chapter]
- 21.(arcgis api for js篇)arcgis api for js矩形采集(SketchViewModel)
- 树莓派设置wifi自动连接
- Room rate system - login optimization
猜你喜欢
Graphical tools package yolov5 and generate executable files exe
亚像素级角点检测Opencv-cornerSubPix
ubuntu20安装redisjson记录
源代码保密的意义和措施
How to customize the shortcut key for latex to stop running
Under the tide of "going from virtual to real", Baidu AI Cloud is born from real
「小样本深度学习图像识别」最新2022综述
制作(转换)ico图标
华为小米互“抄作业”
When you go to the toilet, you can clearly explain the three Scheduling Strategies of scheduled tasks
随机推荐
21. (article ArcGIS API for JS) ArcGIS API for JS rectangular acquisition (sketchviewmodel)
leetcode
HDU ACM 4578 Transformation-> Segment tree - interval change
Cocos2d-x Box2D物理引擎编译设置
Laravel php artisan 自动生成Model+Migrate+Controller 命令大全
How to replace the backbone of the model
Huawei and Xiaomi "copy each other"
Open3D 网格滤波
Sorting operation partition, argpartition, sort, argsort in numpy
函数重入、函数重载、函数重写自己理解
Basic concepts of Huffman tree
树莓派设置静态ip
Search of linear table
Jericho turns on the display icon of the classic Bluetooth hid mobile phone to set the keyboard [chapter]
Optimization of application startup speed
Numpy中排序操作partition,argpartition,sort,argsort
如何替换模型的骨干网络(backbone)
ubuntu20安装redisjson记录
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
Can the applet run in its own app and realize live broadcast and connection?