diff --git a/public/assets/js/app.js b/public/assets/js/app.js index ee58e1b..67a5ed7 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -427,6 +427,8 @@ }, }; + $scope.endingSlashRegex = new RegExp('/$'); + ///////////////////// diff --git a/public/templates/commands.html b/public/templates/commands.html index c907f73..4c7fa09 100644 --- a/public/templates/commands.html +++ b/public/templates/commands.html @@ -3,12 +3,12 @@ step: download -->. Download generated config: nginxconfig.io-{{ getDomains().join(',') }}.zip - Upload to server's {{ data.directory_nginx }} directory + Upload to server's {{ data.directory_nginx.replace(endingSlashRegex, '') }} directory - OR - Copy as Base64 string: Copy to clipboard (echo 'BASE64' | base64 --decode > {{ data.directory_nginx }}nginxconfig.io-{{ getDomains().join(',') }}.zip) Paste from clipboard and run the command . Go to NGINX directory (over SSH): - cd {{ data.directory_nginx }} + cd {{ data.directory_nginx.replace(endingSlashRegex, '') }} . Backup current configuration: tar -czvf nginx_$(date +'%F_%H-%M-%S').tar.gz nginx.conf sites-available/ sites-enabled/ nginxconfig.io/ . Unzip the uploaded archive: @@ -28,8 +28,8 @@ ✔ Let's Encrypt -->. Create a common ACME-challenge directory (for Let's Encrypt): - mkdir -p {{ data.directory_letsencrypt }} - chown {{ data.user }} {{ data.directory_letsencrypt }}-d www.{{ _domain }} -d cdn.{{ _domain }} --email {{ data.sites[_site].email ? data.sites[_site].email : 'info@' + _domain }} -w {{ data.directory_letsencrypt }} -w {{ data.directory_letsencrypt.replace(endingSlashRegex, '') }} -n --agree-tos --force-renewal diff --git a/public/templates/conf/nginxconfig.io/letsencrypt.conf.html b/public/templates/conf/nginxconfig.io/letsencrypt.conf.html index 121b3b9..26317a3 100644 --- a/public/templates/conf/nginxconfig.io/letsencrypt.conf.html +++ b/public/templates/conf/nginxconfig.io/letsencrypt.conf.html @@ -1,4 +1,4 @@ # ACME-challenge location ^~ /.well-known/acme-challenge/ { - root {{ data.directory_letsencrypt }}; + root {{ data.directory_letsencrypt.replace(endingSlashRegex, '') }}; }