伺服器新增站點並安裝 SSL 安全證書

gyp719發表於2018-12-26
lnmp ssl add 
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+

// 設定域名
Please enter domain(example: www.lnmp.org): pay.mgtv100.com

// 設定別名
Enter more domain name(example: lnmp.org *.lnmp.org): 回車

// 設定預設目錄
Please enter the directory for domain v.laobuluo.com: /home/wwwroot/pay.mgtv100.com

// 重寫規則
Allow Rewrite rule? (y/n) y

// 規則型別 wordpress 指定 public 目錄下,other 指向域名目錄
Please enter the rewrite of programme, 
wordpress,discuzx,typecho,thinkphp,laravel,codeigniter,yii2 rewrite was exist.
(Default rewrite: other): other

// 開啟日誌記錄
Allow access log? (y/n) y

// 開啟 pathinfo 模式
Enable PHP Pathinfo? (y/n) y

/ 有自有證照選擇 1 並制定金鑰地址
// 沒有則選擇 2 會自動生成

Enter access log filename(Default:v.laobuluo.com.log):
You access log filename: pay.mgtv100.com.log
1: Use your own SSL Certificate and Key
2: Use Let's Encrypt to create SSL Certificate and Key
Enter 1 or 2: 2

顯示 success 代表成功!

強制調轉 https
 if ($ssl_protocol = "") { return 301 https://$host$request_uri; }
本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章