Commit 3c90cc8e authored by Vitaly Lipatov's avatar Vitaly Lipatov

add nginx-le for letsencrypt support

parent 78beff2c
#!/bin/sh -x
DOMAIN=$1
[ -n "$DOMAIN" ] || exit
DIR=/var/spool/nginx/tmp/client
# add
# include include/letsencrypt.conf;
serv nginx reload
letsencrypt certonly --webroot -w$DIR -d $DOMAIN || exit
NCONF=/etc/nginx/sites-enabled.d/$DOMAIN.conf
KEY=/etc/letsencrypt/live/$DOMAIN/privkey.pem
PEM=/etc/letsencrypt/live/$DOMAIN/fullchain.pem
SP="[ ]"
subst "s|\(ssl_certificate$SP\)\($SP*\).*|\1\2$PEM;|g" $NCONF
subst "s|\(ssl_certificate_key$SP\)\($SP*\).*|\1\2$KEY;|g" $NCONF
serv nginx reload
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment