Files
Deployments/NginxAndLetsencrypt/README.md
2020-05-12 10:05:38 +08:00

41 lines
975 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# A repository fork from [https://github.com/wmnnd/nginx-certbot](nginx-certbot)
## 用途
使用`docker-compose`配置nginx并申请certbot证书。
## 文件说明
* `init-letsencrypt.sh`获取Let's Encrypt证书
* `server/nginx`nginx配置文件目录
* `docker-compose.yml`:服务配置;
## 使用说明
1.解析域名到你的服务器;
2.安装docker-compose参考 <a href="https://www.4spaces.org/centos-install-docker-compose/" target="_blank">CENTOS安装Docker Compose</a>
3.修改配置;
* 修改`init-letsencrypt.sh`文件中的域名及邮箱;
* 修改`server/nginx`中的配置文件里的域名如有必要把sample.conf改成实际的文件名。但如果不做修改只要其中的域名正确不影响证书申请。
4.申请证书
```
chmod +x ./init-letsencrypt.sh
sudo ./init-letsencrypt.sh
```
5.启动服务
```
docker-compose up -d
```
## 测试环境
* CentOS Linux release 7.3.1611 (Core)