1、申请证书,从我的域名列表 右侧的操作栏中点击- ssl
2、配置 nginx config -> /etc/nginx/sites-enabled/default
底部添加:(我的是django+nginx,所以利用uwsgi转发请求) , 然后重启nginx服务 service nginx restart
server { listen 443 ssl; server_name vip.dayu1.net; ssl_certificate cert/1525771112168.pem; ssl_certificate_key cert/1525771112168.key; server_tokens off; fastcgi_param HTTPS on; fastcgi_param HTTP_SCHEME https; access_log /var/log/nginx/identifyImg.access.log; error_log /var/log/nginx/identifyImg.error.log; location /api { include uwsgi_params; uwsgi_pass 127.0.0.1:8000; uwsgi_read_timeout 600; } location / { expires 30d; autoindex on; add_header Cache-Control private; alias /var/www/vsport_web/web/; try_files $uri $uri/ /index.html; } }
3、非常坑的一步,在阿里云-控制台-ecs服务器-安全组规则中添加 默认的ssh端口开放