From f1db6fc108aa36f51cf48b45ec0f39be2953cff4 Mon Sep 17 00:00:00 2001 From: Vladimir Gorej Date: Tue, 7 Mar 2023 10:41:37 +0100 Subject: [PATCH] fix(docker): enable IPv6 explicitly by env variable Enabling IPv6 address and port for IPv6 addresses caused backward incompatible issues in the docker image. Refs #8447 --- docker/docker-entrypoint.d/40-swagger-ui.sh | 5 +++++ docker/nginx.conf | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/docker-entrypoint.d/40-swagger-ui.sh b/docker/docker-entrypoint.d/40-swagger-ui.sh index 2115ba6da50..c65c376ad91 100755 --- a/docker/docker-entrypoint.d/40-swagger-ui.sh +++ b/docker/docker-entrypoint.d/40-swagger-ui.sh @@ -39,6 +39,11 @@ if [[ -f "$SWAGGER_JSON" ]]; then sed -i "s|http://example.com/api|$REL_PATH|g" $INITIALIZER_SCRIPT fi +# enable/disable the address and port for IPv6 addresses that nginx listens on +if [[ -n "${PORT_IPV6}" ]]; then + sed -i "s|8080;|8080;\n listen [::]:${PORT_IPV6};|g" $NGINX_CONF +fi + # replace the PORT that nginx listens on if PORT is supplied if [[ -n "${PORT}" ]]; then sed -i "s|8080|${PORT}|g" $NGINX_CONF diff --git a/docker/nginx.conf b/docker/nginx.conf index 0396936f916..e6d55deb781 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -30,7 +30,6 @@ http { server { listen 8080; - listen [::]:8080; server_name localhost; index index.html index.htm;