Add config option to disable Nginx IPv6 lsitener
This commit is contained in:
17
nginx-ipv6.sh
Normal file
17
nginx-ipv6.sh
Normal 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
|
||||
Reference in New Issue
Block a user