先去申请一个免费的ssl证书,可以自己创建,也可以通过第三方来创建,我使用的是WOSIGN
然后将得到的两个文件 1_longquangege.cn_bundle.crt , 2_longquangege.cn.key 放到服务器上
接下来配置nginx的conf文件 下面是我个人的配置文件,参考使用
server {
listen 80;
listen 443 ssl;
server_name www.longquangege.cn longquangege.cn;
index index.html index.htm index.php;
root /var/www/CN_WordPress;
#ssl on;
ssl_certificate_key /usr/local/nginx/conf/vhost/ssl/2_longquangege.cn.key;
ssl_certificate /usr/local/nginx/conf/vhost/ssl/1_longquangege.cn_bundle.crt;
if ($server_port = 80) {
return 301 https://$server_name$request_uri;
}
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
error_page 497 https://$server_name$request_uri;
…
然后就是重启nginx服务 测试一下吧
Now you tell me she’s not a knock-out!
Call it even.
Why do not we try this ?
I was wondering if after work we could grab a cup of coffee
this can be a very useful web site!
nice going!
You are so cute.