1. Find the main nginx configuration file nginx.conf
Example:
[root@shuaishuai ~]# find / -name nginx.conf
2.切换目录
Example:
[root@shuaishuai ~]# cd /usr/local/nginx/conf/nginx.conf
3.vim edit the main configuration file nginx.conf to find out the configuration path of the certificate
Example:
[root@shuaishuai conf]# vim nginx.conf
4. Switch to the directory where the certificate file is located
Example:
[root@shuaishuai conf]# cd /usr/local/nginx/conf/cert
[root@shuaishuai cert]# ls
5. Back up the old certificate and upload the new one
Example:
[root@shuaishuai cert]# mv www.shuaijun.vip.pem www.shuaijun.vip.pem.bak
[root@shuaishuai cert]# mv www.shuaijun.vip.key www.shuaijun.vip.key.bak
6. Rename the uploaded new certificate name to the name of the old certificate
Example:
[root@shuaishuai cert]# mv 123.www.shuaijun.vip.pem www.shuaijun.vip.pem
[root@shuaishuai cert]# mv 123.www.shuaijun.vip.key www.shuaijun.vip.key
7. Check the configuration file and restart the nginx service
Example:
[root@shuaishuai cert]# nginx -t
[root@shuaishuai cert]# killall -1 nginx