1.上传证书到服务器,解压
2.
server {
#listen 80;
#listen [::]:80 ;
# SSL configuration
#
listen 443 ssl;
listen [::]:443 ssl;
ssl on;
#证书和密钥存放地址
ssl_certificate /etc/nginx/cert/4058540_api.dameiketang.com.pem;
ssl_certificate_key /etc/nginx/cert/4058540_api.dameiketang.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;
3.
server {
listen 80;
listen [::]:80;
server_name api.dameiketang.com;
return 301 https://$host$request_uri;
}
发表评论: