1. 域名
在萬(wàn)網(wǎng)購(gòu)買,略
2. 云服務(wù)器
阿里云購(gòu)買,略
3. 安裝lnmp
使用lnmp.org程序,略
4. 申請(qǐng)證書(shū)
阿里云-管理控制臺(tái)-安全(云盾)-證書(shū)服務(wù)-購(gòu)買證書(shū)
證書(shū)類型: 免費(fèi)型DV SSL
選擇品牌: Symantec

購(gòu)買成功后,綁定域名,配置DNS解析記錄生效

5. 配置HTTPS服務(wù)器
Nginx的安裝目錄下創(chuàng)建cert目錄
下載證書(shū),放到cert目錄
修改nginx.conf文件,加入443端口及證書(shū)目錄
-
server
-
{
-
listen 80;
-
listen 443 ssl;
-
#listen [::]:80;
-
server_name cet.fangbei.org;
-
index index.html index.htm index.php default.html default.htm default.php;
-
root /home/wwwroot/cet.fangbei.org;
-
-
include none.conf;
-
#error_page 404 /404.html;
-
include enable-php.conf;
-
-
ssl_certificate /usr/local/nginx/cert/214130435490250.pem;
-
ssl_certificate_key /usr/local/nginx/cert/214130435490250.key;
-
-
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
-
{
-
expires 30d;
-
}
-
-
location ~ .*\.(js|css)?$
-
{
-
expires 12h;
-
}
-
-
location ~ /\.
-
{
-
deny all;
-
}
-
-
access_log off;
-
}
重啟lnmp即可。
6. 使用https訪問(wèn)網(wǎng)站
支持80端口和443訪問(wèn)
http://cet.fangbei.org/
https://cet.fangbei.org/
https訪問(wèn)時(shí),可以看到證書(shū)

|