diff --git a/src/scripts/run_certbot.sh b/src/scripts/run_certbot.sh index bb10b8c..5f6241a 100644 --- a/src/scripts/run_certbot.sh +++ b/src/scripts/run_certbot.sh @@ -169,5 +169,11 @@ done # did indeed get certificates for. auto_enable_configs +# Make sure the Nginx configs are valid. +if ! nginx -t; then + error "Nginx configuration is invalid, skipped reloading. Check the logs for details." + exit 0 +fi + # Finally, tell Nginx to reload the configs. nginx -s reload diff --git a/src/scripts/run_local_ca.sh b/src/scripts/run_local_ca.sh index 55bd0ef..d903454 100644 --- a/src/scripts/run_local_ca.sh +++ b/src/scripts/run_local_ca.sh @@ -247,5 +247,11 @@ done # did indeed succeed with. auto_enable_configs +# Make sure the Nginx configs are valid. +if ! nginx -t; then + error "Nginx configuration is invalid, skipped reloading. Check the logs for details." + exit 0 +fi + # Finally, tell Nginx to reload the configs. nginx -s reload