配置 Let\’s Encrypt
最后更新于:2022-04-02 02:34:09
[TOC]
## 概述
```
> lnmp ssl add
Please enter domain(example: www.lnmp.org): ezlost.com
Your domain: ezlost.com
Enter more domain name(example: lnmp.org *.lnmp.org):
Please enter the directory for domain ezlost.com: /home/wwwroot/ezlost.com
Allow Rewrite rule? (y/n) y
Please enter the rewrite of programme,
wordpress,discuzx,typecho,thinkphp,laravel,codeigniter,yii2 rewrite was exist.
(Default rewrite: other): wordpress
You choose rewrite: wordpress
Allow access log? (y/n) y
Enter access log filename(Default:ezlost.com.log):
You access log filename: ezlost.com.log
Enable PHP Pathinfo? (y/n) y
Enable pathinfo.
1: Use your own SSL Certificate and Key
2: Use Let's Encrypt to create SSL Certificate and Key
Enter 1 or 2: 2
```
## 301重定向到https
设置
![](https://starrycat.me/wp-content/uploads/2018/02/02_05.png)
```
if ($scheme = http ) {
return 301 https://$host$request_uri;
}
```
';