Add config option to disable Nginx IPv6 lsitener

This commit is contained in:
Immánuel!
2026-01-02 23:19:10 +01:00
committed by GitHub
parent 55f4beb86d
commit 5b7319b520
2 changed files with 21 additions and 0 deletions

17
nginx-ipv6.sh Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
# @see: https://github.com/nginx/docker-nginx-unprivileged/tree/main/stable/alpine-slim
set -e
entrypoint_log() {
if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then
echo "$@"
fi
}
if [ -n "$DISABLE_IPV6" ]; then
entrypoint_log "Disabling the Nginx IPv6 listener"
sed -i '/^[[:space:]]*listen[[:space:]]*\[::\]:[0-9]*/s/^/#/' /etc/nginx/nginx.conf
fi
exit 0