blog升级为https了

https.png

虽然是p大点的事,但我就是要拿出来说一下


假分割线


在腾讯云那里申请了一个一年的免费ssl证书,然后给装上去了,改了一下nginx的配置文件,443端口是这样的

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
server {
    listen 443;
    server_name blog.lomot.cn;
    ssl on;
    ssl_certificate 1_blog.lomot.cn_bundle.crt;
    ssl_certificate_key 2_blog.lomot.cn.key;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass	 http://127.0.0.1:2368;
        client_max_body_size 35m;
    }
}

然后80端口改成转到443口

1
2
3
4
5
server {  
    listen  80;  
    server_name blog.lomot.cn;  
    rewrite ^(.*)$  https://$host$1 permanent;  
}