Skip to content

Commit

Permalink
Create backup of nginx configuration before changing it
Browse files Browse the repository at this point in the history
  • Loading branch information
obermeier committed Dec 19, 2023
1 parent e10310d commit 63c83db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
set -e

if [ ! -z "$NGINX_SSL" ] && [ "$NGINX_SSL" = "true" ]; then

rm /etc/nginx/conf.d/default.conf
ln -s /app/nginx-confs/ssl.conf /etc/nginx/conf.d/default.conf
elif [ ! -z "$SP_HTTP_SERVER_ADAPTER_ENDPOINT" ]; then
DEFAULT_CONF_BACKUP="/etc/nginx/conf.d/default.conf_$(date +%s).bak"
echo "Create backup of old configuration $DEFAULT_CONF_BACKUP"
cp /etc/nginx/conf.d/default.conf $DEFAULT_CONF_BACKUP

rm /etc/nginx/conf.d/default.conf
envsubst '\$SP_HTTP_SERVER_ADAPTER_ENDPOINT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
fi
Expand Down

0 comments on commit 63c83db

Please sign in to comment.