Merge pull request #8 from imeesa/main

fix confusing behavior with nginx config
This commit is contained in:
Naterfute
2025-12-03 14:26:57 -08:00
committed by GitHub

View File

@@ -27,7 +27,6 @@ fi
rm -f /app/.env
ln -s /app/var/.env /app/
# Use a subshell to avoid polluting the global environment
(
# Load in any existing environment variables in the .env file
@@ -55,6 +54,21 @@ ln -s /app/var/.env /app/
fi
)
if [ -f /etc/nginx/http.d/panel.conf ]; then
nginx -t
if [[ $? -ne 0 ]]; then
echo "nginx config test failed, regenerating"
rm /etc/nginx/http.d/panel.conf
fi
if [[ $LE_EMAIL ]]; then
grep "server_name $APP_URL" /etc/nginx/http.d/panel.conf
if [[ $? -ne 0 ]]; then
echo "APP_URL not found in nginx config, regenerating"
rm /etc/nginx/http.d/panel.conf
fi
fi
fi
echo "Checking if https is required."
if [ -f /etc/nginx/http.d/panel.conf ]; then