mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 13:24:25 -07:00
LetsEncrypt to use Apache if myVesta is behind main nginx
This commit is contained in:
parent
d0e24ed92f
commit
62ec3bb5a7
1 changed files with 16 additions and 15 deletions
|
@ -165,22 +165,23 @@ for auth in $authz; do
|
|||
mkdir -p $acme_challenge
|
||||
echo "$token.$THUMB" > $acme_challenge/$token
|
||||
chown -R $user:$user $well_known
|
||||
else
|
||||
# default nginx method
|
||||
conf="$HOMEDIR/$user/conf/web/nginx.$domain.conf_letsencrypt"
|
||||
sconf="$HOMEDIR/$user/conf/web/snginx.$domain.conf_letsencrypt"
|
||||
if [ ! -e "$conf" ]; then
|
||||
echo 'location ~ "^/\.well-known/acme-challenge/(.*)$" {' \
|
||||
> $conf
|
||||
echo ' default_type text/plain;' >> $conf
|
||||
echo ' return 200 "$1.'$THUMB'";' >> $conf
|
||||
echo '}' >> $conf
|
||||
fi
|
||||
if [ ! -e "$sconf" ]; then
|
||||
ln -s "$conf" "$sconf"
|
||||
fi
|
||||
$BIN/v-restart-proxy
|
||||
check_result $? "Proxy restart failed" >/dev/null
|
||||
fi
|
||||
conf="$HOMEDIR/$user/conf/web/nginx.$domain.conf_letsencrypt"
|
||||
sconf="$HOMEDIR/$user/conf/web/snginx.$domain.conf_letsencrypt"
|
||||
if [ ! -e "$conf" ]; then
|
||||
echo 'location ~ "^/\.well-known/acme-challenge/(.*)$" {' \
|
||||
> $conf
|
||||
echo ' default_type text/plain;' >> $conf
|
||||
echo ' return 200 "$1.'$THUMB'";' >> $conf
|
||||
echo '}' >> $conf
|
||||
fi
|
||||
if [ ! -e "$sconf" ]; then
|
||||
ln -s "$conf" "$sconf"
|
||||
fi
|
||||
$BIN/v-restart-proxy
|
||||
check_result $? "Proxy restart failed" >/dev/null
|
||||
|
||||
else
|
||||
well_known="$HOMEDIR/$user/web/$domain/public_html/.well-known"
|
||||
acme_challenge="$well_known/acme-challenge"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue