This commit is contained in:
VirtuBox 2018-04-27 20:06:28 +02:00
parent 6007357f4e
commit 0dc3892623
1 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,7 @@ then
exit 1
fi
~/.acme.sh/acme.sh --issue -d "$domain_name" -d www."$domain_name" --keylength ec-384 --dns dns_cf --dnssleep 60
~/.acme.sh/acme.sh --issue -d $domain_name -d www.$domain_name --keylength ec-384 --dns dns_cf --dnssleep 60
if [ ! -d /etc/letsencrypt/live/$domain_name ]; then
@ -24,7 +24,7 @@ mkdir -p /etc/letsencrypt/live/$domain_name
fi
# install the cert and reload nginx
acme.sh --install-cert -d "$domain_name" --ecc \
acme.sh --install-cert -d $domain_name --ecc \
--cert-file /etc/letsencrypt/live/$domain_name/cert.pem \
--key-file /etc/letsencrypt/live/$domain_name/key.pem \
--fullchain-file /etc/letsencrypt/live/$domain_name/fullchain.pem \
@ -44,15 +44,15 @@ cat <<EOF >/var/www/$domain_name/conf/nginx/ssl.conf
EOF
fi
if [ ! -f /etc/nginx/conf.d/force-ssl-"$domain_name".conf ]; then
if [ ! -f /etc/nginx/conf.d/force-ssl-$domain_name.conf ]; then
# add the redirection from http to https
cat <<EOF >/etc/nginx/conf.d/force-ssl-"$domain_name".conf
cat <<EOF >/etc/nginx/conf.d/force-ssl-$domain_name.conf
server {
listen 80;
listen [::]:80;
server_name "$domain_name" www.$domain_name;
server_name $domain_name www.$domain_name;
return 301 https://$domain_name\$request_uri;
}
EOF
@ -76,7 +76,7 @@ then
fi
# issue cert
acme.sh --issue -d "$domain_name" --keylength ec-384 --dns dns_cf --dnssleep 60
acme.sh --issue -d $domain_name --keylength ec-384 --dns dns_cf --dnssleep 60
if [ ! -d /etc/letsencrypt/live/$domain_name ]; then
@ -84,7 +84,7 @@ if [ ! -d /etc/letsencrypt/live/$domain_name ]; then
mkdir -p /etc/letsencrypt/live/$domain_name
fi
if [ ! -f /etc/nginx/conf.d/force-ssl-"$domain_name".conf ]; then
if [ ! -f /etc/nginx/conf.d/force-ssl-$domain_name.conf ]; then
# add certificate to the nginx vhost configuration
cat <<EOF >/var/www/$domain_name/conf/nginx/ssl.conf
listen 443 ssl http2;
@ -96,7 +96,7 @@ cat <<EOF >/var/www/$domain_name/conf/nginx/ssl.conf
EOF
fi
if [ ! -f /etc/nginx/conf.d/force-ssl-"$domain_name".conf ]; then
if [ ! -f /etc/nginx/conf.d/force-ssl-$domain_name.conf ]; then
# add the redirection from http to https
cat <<EOF >/etc/nginx/conf.d/force-ssl-$domain_name.conf
server {
@ -109,7 +109,7 @@ EOF
fi
# install the cert and reload nginx
.acme.sh/acme.sh --install-cert -d "$domain_name" --ecc \
.acme.sh/acme.sh --install-cert -d $domain_name --ecc \
--cert-file /etc/letsencrypt/live/$domain_name/cert.pem \
--key-file /etc/letsencrypt/live/$domain_name/key.pem \
--fullchain-file /etc/letsencrypt/live/$domain_name/fullchain.pem \