服务器添加站点并安装 SSL 安全证书
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 协议》,转载必须注明作者和本文链接
推荐文章: