## https 配置
>[info] nginx 配置443
~~~
listen 80;
listen 443 ssl;
server_name localhost;
#ssl_certificate /data/cert/localhost.crt;
#ssl_certificate_key /data/cert/localhost.key;
ssl_certificate /data/cert/2017.pem;
ssl_certificate_key /data/cert/2017.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;
~~~
>[info] http切换https
~~~
server {
listen 80;
server_name localhost;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name m.com.cn;
#...
}
~~~