avatar1 avatar
@{[{user.name}]}
希腊·圣域
since February 1500
Ghost (nginx) 配置SSL 06 June 2016 22:00:13

因为服务端用的是unbuntu 14.04版本,跟官方网站中的配置例子有很多不一样的地方,导致最后还是花费了很多时间自己摸索了一下才算过关,整理出来方便大家参考吧。

假设你已经成功安装并运行Ghost到你自己的服务器(vps), 包括域名也解析成果。这里有个问题,配置Ghost的config.js的时候不要占用80和443端口

SSL证书

你需要准备两个文件,xx.crtxx.key,一个是你的证书,另一个是私匙,有很多SSL的供应商,你可以选一个合适你自己的,一般作为博客类站点都可以用Domain Validation直接在线签发SSL证书。

安装nginx

首先需要明确的是SSL的证书并不是直接配置到Ghost的,需要借助讲SSL证书装配到nginx,再由nginx来做路由代理分发http(s)请求到Ghost,所以你需要安装nginx:

sudo apt-get install nginx

加载SSL证书到nginx

在nginx目录下创建一个名为ssl的子目录: mkdir /etc/nginx/ssl

将你得到的 xx.crtxx.key 复制到ssl子目录,推荐使用 FileZilla 这个软件来连接你的vps进行文件复制

打开nginx的配置文件 sudo nano /etc/nginx/sites-available/default

添加以下内容:

server {  
    listen 80;
    server_name your_domain.com www.your_domain.com;
    return 301 https://$server_name$request_uri; #强制SSL
}
server {  
    listen 443 ssl;
    server_name your_domain.com www.your_domain.com;
    ssl_certificate      /etc/nginx/ssl/server.crt;
IELTS Vocabularies 06 June 2016 12:00:29

dimension [dɪ'mɛnʃ(ə)n; daɪ-]

This is to enable to get a feel of your vehicle's dimensions.

apparently

Apparently you won't pass your exam.

scissors ['sɪzɚz]

I cannot find my scissors!

anonymous [ə'nɑnəməs]

You can complain that by sending anonymous letters to our mayor.

explicitly [ɪk'splɪsɪtli]

Tell them explicitly you want continue this the friendship.

tortoise [ˈtɔrtəs]

Such a cute tortoise.

exhibition [,ɛksɪ'bɪʃən]

Did you go to the IT exhibition?

significantly [sɪg'nɪfɪkəntli]

They got a significant performance improvement in the testing.

despite [dɪ'spaɪt]

I failed the test despite studying all night.

prohibit [prə'hɪbɪt]

Smoking is prohibited here.

participate [pɑr'tɪsə'pet] participant

2016年 06 June 2016 08:00:00

2016年几乎已经过完一半了,回头看之前设定的任务基本都没有完成,而且越来越觉得自己过于懒散了。

拖延症越来越厉害,就这样下去梦想是无法实现的,要怎么做自己应该非常清楚吧。过去的这半年一句再简单不过的谚语可以概括这一切:

明日复明日,明日何其多,日日待明日,万事成蹉跎。

好自为之吧。

It's almost the middle of 2016, look back all those arranged tasks haven't been completed yet, even worse you're becoming more and more sluggish.

Things are delayed times by times, you'll be unable to accomplish any of your dreams, you are so clearly knowing what to do and how to start.

Behave yourself, please.

当前第 2页,一共 2页