需要用到crt以及key两个文件,并且放到一个指定目录修改其权限;

server{

listen 80;

server_name URL;

rewrite  ^(.*)$  https://$host$1;

}

server {
listen 443 ssl;
server_name URL;
access_log /var/log/nginx/https_access.log main;

#ssl on;

ssl_certificate /etc/nginx/cert/2447549_www.testpm.cn.pem;
ssl_certificate_key /etc/nginx/cert/2447549_www.testpm.cn.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}

此作者没有提供个人介绍
最后更新于 2024-11-25