diff --git a/bin/v-check-letsencrypt-domain b/bin/v-check-letsencrypt-domain index 64c70516..6b835ec3 100755 --- a/bin/v-check-letsencrypt-domain +++ b/bin/v-check-letsencrypt-domain @@ -89,12 +89,16 @@ uri=$(echo "$answer" |grep -A 3 http-01 |grep uri |cut -f 4 -d \") # Adding location wrapper for request challenge if [ "$WEB_SYSTEM" = 'nginx' ] || [ "$PROXY_SYSTEM" = 'nginx' ]; then conf="$HOMEDIR/$user/conf/web/nginx.$r_domain.conf_letsencrypt" + sconf="$HOMEDIR/$user/conf/web/snginx.$r_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 else acme="$HOMEDIR/$user/web/$r_domain/public_html/.well-known/acme-challenge" if [ ! -d "$acme" ]; then diff --git a/web/edit/web/index.php b/web/edit/web/index.php index 75b6942c..11cda0ea 100644 --- a/web/edit/web/index.php +++ b/web/edit/web/index.php @@ -279,7 +279,7 @@ if (!empty($_POST['save'])) { } // Change SSL certificate - if (( $v_letsencrypt == 'no' ) && ( $v_ssl == 'yes' ) && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) { + if (( $v_letsencrypt == 'no' ) && (empty($_POST['v_letsencrypt'])) && ( $v_ssl == 'yes' ) && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) { if (( $v_ssl_crt != str_replace("\r\n", "\n", $_POST['v_ssl_crt'])) || ( $v_ssl_key != str_replace("\r\n", "\n", $_POST['v_ssl_key'])) || ( $v_ssl_ca != str_replace("\r\n", "\n", $_POST['v_ssl_ca']))) { exec ('mktemp -d', $mktemp_output, $return_var); $tmpdir = $mktemp_output[0];