check for a customized nginx configuration

webserver configuration as it now stands in the documentation foresees only help in a barebone install enviroment. It could be immensely useful for a docker compose setup to check if the nginx configuration file (default) is already available through mounted volumes; if so it skips the regeneration of it (that as it's now it overwrite every user edit to it)
This commit is contained in:
Azertooth 2021-04-23 19:35:48 +02:00 committed by GitHub
parent 8eadbd39a1
commit 94889ffc31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,6 +120,14 @@ fi
if [ "$1" = 'zammad-nginx' ]; then if [ "$1" = 'zammad-nginx' ]; then
check_zammad_ready check_zammad_ready
# check if a customized nginx configuration is already available
CONF=/etc/nginx/sites-enabled/default
if [ -f "$CONF" ]; then
echo "starting nginx..."
exec /usr/sbin/nginx -g 'daemon off;'
else
# configure nginx # configure nginx
sed -e "s#listen .*#listen ${NGINX_PORT};#g" \ sed -e "s#listen .*#listen ${NGINX_PORT};#g" \
-e "s#proxy_set_header X-Forwarded-Proto .*;#proxy_set_header X-Forwarded-Proto ${NGINX_SERVER_SCHEME};#g" \ -e "s#proxy_set_header X-Forwarded-Proto .*;#proxy_set_header X-Forwarded-Proto ${NGINX_SERVER_SCHEME};#g" \