1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:31 +02:00

update letsencrypt

This commit is contained in:
kev 2016-01-16 13:39:09 +08:00
parent ba32d9bb45
commit b83c9aabdb
2 changed files with 18 additions and 18 deletions

View File

@ -14,42 +14,42 @@ letsencrypt:
- "80:80"
- "443:443"
volumes:
- "/etc/letsencrypt:/etc/letsencrypt"
- "/var/lib/letsencrypt:/var/lib/letsencrypt"
- "./etc/letsencrypt:/etc/letsencrypt"
- "./var/lib/letsencrypt:/var/lib/letsencrypt"
```
## up and running
```
# stop nginx
# stop nginx (release 80/tcp and 443/tcp)
$ systemctl stop nginx
# generate keys
$ docker-compose run --rm --service-ports letsencrypt
>>> email: admin@datageek.info
>>> domains: datageek.info blog.datageek.info
>>> domains: datageek.info,bbs.datageek.info,blog.datageek.info,wiki.datageek.info
# copy keys
$ mkdir -p /etc/nginx/ssl/
$ cp /etc/letsencrypt/live/datageek.info/fullchain.pem /etc/nginx/ssl/datageek.info.crt
$ cp /etc/letsencrypt/live/datageek.info/privkey.pem /etc/nginx/ssl/datageek.info.key
$ cp ./etc/letsencrypt/live/datageek.info/fullchain.pem /etc/nginx/ssl/datageek.info.crt
$ cp ./etc/letsencrypt/live/datageek.info/privkey.pem /etc/nginx/ssl/datageek.info.key
# reconfig nginx
$ vi /etc/nginx/sites-enabled/default
server {
listen 80 default;
server_name _;
return 301 https://$host$request_uri;
listen 80 default;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name datageek.info blog.datageek.info;
ssl_certificate ssl/datageek.info.crt;
ssl_certificate_key ssl/datageek.info.key;
location / {
proxy_pass http://127.0.0.1:8000;
}
listen 443 ssl;
server_name datageek.info blog.datageek.info;
ssl_certificate ssl/datageek.info.crt;
ssl_certificate_key ssl/datageek.info.key;
location / {
proxy_pass http://127.0.0.1:8000;
}
}
# start nginx

View File

@ -5,5 +5,5 @@ letsencrypt:
- "80:80"
- "443:443"
volumes:
- "/etc/letsencrypt:/etc/letsencrypt"
- "/var/lib/letsencrypt:/var/lib/letsencrypt"
- "./etc/letsencrypt:/etc/letsencrypt"
- "./var/lib/letsencrypt:/var/lib/letsencrypt"