diff --git a/nginx/acme.cfg b/nginx/acme.cfg new file mode 100644 index 0000000..043ea19 --- /dev/null +++ b/nginx/acme.cfg @@ -0,0 +1,10 @@ +# Serve only through HTTP while updating the certificate +server { + listen 80; + server_name kornerr.ru; + root /var/www/html; + + location / { + try_files $uri $uri/ =404; + } +} diff --git a/nginx/cfg b/nginx/prod.cfg similarity index 97% rename from nginx/cfg rename to nginx/prod.cfg index c065037..c2e7549 100644 --- a/nginx/cfg +++ b/nginx/prod.cfg @@ -5,6 +5,7 @@ server { return 301 https://$server_name$request_uri; } +# Serve through HTTPS only server { listen 443 ssl; server_name kornerr.ru; diff --git a/step/copyNginxACMEConfig b/step/copyNginxACMEConfig index f9b43ba..124a7d1 100644 --- a/step/copyNginxACMEConfig +++ b/step/copyNginxACMEConfig @@ -2,4 +2,4 @@ STEP=$((STEP+1)) echo -e "\n> > > > Шаг №$STEP. Копируем настройки Nginx для ACME" -cp $SDIR/../nginx/cfg-acme /etc/nginx/sites-enabled/default +cp $SDIR/../nginx/acme.cfg /etc/nginx/sites-enabled/default diff --git a/step/copyNginxProdConfig b/step/copyNginxProdConfig index 71b4aa7..01ef89f 100644 --- a/step/copyNginxProdConfig +++ b/step/copyNginxProdConfig @@ -2,4 +2,4 @@ STEP=$((STEP+1)) echo -e "\n> > > > Шаг №$STEP. Копируем боевые настройки Nginx" -cp $SDIR/../nginx/cfg /etc/nginx/sites-enabled/default +cp $SDIR/../nginx/prod.cfg /etc/nginx/sites-enabled/default