Nginx 安装 SSL 配置 HTTPS 超简单

发布者: xiaozhimn

第一步:配置 ssh服务器

server {
listen 443 ssl;
server_name mini.uyi2.com www.mini.uyi2.com;
ssl_certificate /home/ssl/3411919_mini.uyi2.com.pem;
ssl_certificate_key /home/ssl/3411919_mini.uyi2.com.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
root /home/mini;
index index.html index.htm;
}
}

第二步:配置一个301的重定向到443服务的server

server {
listen 80;
server_name mini.uyi2.com www.mini.uyi2.com;
return 301 https://$server_name$request_uri;
}

是不是很简单

0赞