Issue #58: Add config option to disable IPv6 support in nginx

This commit is contained in:
Dale Davies
2023-03-01 14:55:43 +00:00
parent 6d4931f1ea
commit 0d74bd05ff
2 changed files with 18 additions and 6 deletions

View File

@@ -76,6 +76,7 @@ You can use the following optional environment variables to configure/customise
- `NOINDEX: 'true'` - Include a robots noindex meta tag in site header.
- `CACHEBYPASS: 'true'` - Bypass all caches, useful for testing changes.
- `WWWURL` - Useful if Jump is hosted in a sub-directory (e.g. "/startpage").
- `DISABLEIPV6` - Disable IPV6 if required.
**NOTE:** The `OWMAPIKEY` and `LATLONG` config options must be defined together.

View File

@@ -68,16 +68,27 @@ if [ -z "${DEVELOPMENT-}" ]; then
fi
fi
echo >&2 "";
echo >&2 "- All done! Starting nginx/php services now."
echo >&2 "";
echo >&2 "-------------------------------------------------------------"
echo >&2 "";
else
echo >&2 "";
echo >&2 "- Setting correct ownership of xdebug dir"
chown -R jumpapp:jumpapp /tmp/xdebug
fi
DISABLEIPV6=$(echo "${DISABLEIPV6:-}" | tr '[:upper:]' '[:lower:]')
if [ "$DISABLEIPV6" == "true" ] || [ "$DISABLEIPV6" == "1" ]; then
echo >&2 "";
echo >&2 "- Disabling IPv6 in nginx config"
sed -E -i 's/^([^#]*)listen \[::\]/\1#listen [::]/g' /etc/nginx/nginx.conf
else
sed -E -i 's/^(\s*)#listen \[::\]/\1listen [::]/g' /etc/nginx/nginx.conf
fi
echo >&2 "";
echo >&2 "- All done! Starting nginx/php services now."
echo >&2 "";
echo >&2 "-------------------------------------------------------------"
echo >&2 "";
php-fpm8
nginx -g 'daemon off;'